-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Jiterpreter performance issues around Dictionary and GenericEqualityComparer #82948
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 DetailsDescriptionThe way Dictionary and GenericEqualityComparer interact causes performance issues in the Jiterpreter that would be hard to fix without changes to the interpreter and/or the BCL. For more details see dotnet/perf-autofiling-issues#12762 (comment) but to summarize: The Dictionary<int, int>.ContainsValue benchmark regressed once the jiterpreter was enabled.
ConfigurationThis applies to WebAssembly non-AOT (mono interpreter) with the jiterpreter enabled. Regression?Performance regresses for this code with the jiterpreter enabled DataAnalysisCandidate changes that might entirely make this go away, while also just making these code paths faster in the mono interpreter:
|
Tagging subscribers to this area: @BrzVlad, @kotlarmilos Issue DetailsDescriptionThe way Dictionary and GenericEqualityComparer interact causes performance issues in the Jiterpreter that would be hard to fix without changes to the interpreter and/or the BCL. For more details see dotnet/perf-autofiling-issues#12762 (comment) but to summarize: The Dictionary<int, int>.ContainsValue benchmark regressed once the jiterpreter was enabled.
ConfigurationThis applies to WebAssembly non-AOT (mono interpreter) with the jiterpreter enabled. Regression?Performance regresses for this code with the jiterpreter enabled DataAnalysisCandidate changes that might entirely make this go away, while also just making these code paths faster in the mono interpreter:
|
I think regardless of anything else we choose to do, we should make the interpreter recognize these patterns (sharplab.io sample)
and
|
for example |
I'll take a look to see if there are any easy optimizations to be done here |
We could do a test run with the jiterpreter disabled to see if it gets faster. There are corner cases where jiterpreter traces are slower than interp (due to branch prediction, I believe) but I wouldn't expect to see a large time penalty. |
Description
The way Dictionary and GenericEqualityComparer interact causes performance issues in the Jiterpreter that would be hard to fix without changes to the interpreter and/or the BCL. For more details see dotnet/perf-autofiling-issues#12762 (comment) but to summarize:
The Dictionary<int, int>.ContainsValue benchmark regressed once the jiterpreter was enabled.
GenericEqualityComparer<int>
is used for the benchmark that regressed and it is also very inefficient in this configurationConfiguration
This applies to WebAssembly non-AOT (mono interpreter) with the jiterpreter enabled.
Regression?
Performance regresses for this code with the jiterpreter enabled
Data
https://pvscmdupload.blob.core.windows.net/reports/allTestHistory/refs/heads/main_x64_ubuntu%2018.04_CompliationMode=wasm_RunKind=micro/System.Collections.Tests.Perf_Dictionary.ContainsValue(Items%3a%203000).html
Analysis
Candidate changes that might entirely make this go away, while also just making these code paths faster in the mono interpreter:
The text was updated successfully, but these errors were encountered: