-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Wasm][AOT] Methods containing a try/catch block are 30x slower because of the interpreter #56309
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsDescriptionMethods containing a For example: private static void TestTryCatch()
{
int InvokeMethod(int a)
{
try
{
return a++;
}
catch
{
Console.WriteLine("catch");
return 0;
}
}
var sw = Stopwatch.StartNew();
for (int i = 0; i < 10000000; i++)
{
InvokeMethod(i);
}
sw.Stop();
Console.WriteLine($"TestTryCatch: {sw.ElapsedMilliseconds}");
} Runs in 45ms with df6e956, and 1140ms with e983168 Here's a profiler trace screenshot: ConfigurationWorking commit: df6e956 Regression?Yes Other information
|
Applying this patch to the runtime reverts original behavior, knowing that the original exception handling scenario will be a problem. |
@jeromelaban , when exactly was this change introduced? What is the max version before this change? Thanks. |
@roonius there is no stable version of the runtime that does not have this change. Each interim build had a different set of issues, and removing the interpreter restriction causes failures when handling exceptions, which is why the restriction is present in Uno.Wasm.Bootstrap builds of the runtime. |
With this PR: #63065 |
This is fixed now. |
Description
Methods containing a
try/catch/finally
are 30x slower in recent builds because they are now run through the interpreter.For example:
Runs in 45ms with df6e956, and 1140ms with e983168
Here's a profiler trace screenshot:
Configuration
Working commit: df6e956
Failing commit: e983168 (it probably started doing this before this commit)
Regression?
Yes
Other information
The text was updated successfully, but these errors were encountered: