-
Notifications
You must be signed in to change notification settings - Fork 5k
[Jiterpreter] Add support for TryGetHashCode intrinsic #81644
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
Conversation
Tagging subscribers to this area: @BrzVlad, @kotlarmilos Issue Details#80520 added support in the Jiterpreter for the intrinsic that underlies For reference
|
@kg is there a documented way to test and benchmark Jiterpreter changes? I had BenchmarkDotNet project that defined some custom WASM jobs, but it appears that no longer works. |
It should work the same as anything else, you can manually adjust the tiering thresholds for it so that traces compile sooner (either by passing a runtime arg, or editing the defaults in options-def.h). To set a runtime arg you can pass it from JS when initializing the runtime. |
I found the incantation to make my benchmark work again: ./dotnet.sh build -p:TargetOS=browser -p:TargetArchitecture=wasm -c Release src/mono/wasm/Wasm.Build.Tests /t:InstallWorkloadUsingArtifacts This creates the Anyways, the results of running the benchmark: BenchmarkDotNet=v0.13.3, OS=ubuntu 22.04
AMD Ryzen Threadripper PRO 3955WX 16-Cores, 1 CPU, 32 logical and 16 physical cores
.NET SDK=7.0.102
[Host] : .NET 7.0.2 (7.0.222.60605), X64 RyuJIT AVX2
PR : .NET Core (Mono) 8.0.0-dev, Wasm AOT
merge-base : .NET Core (Mono) 8.0.0-dev, Wasm AOT
Runtime=Wasm IterationCount=15 LaunchCount=2
WarmupCount=10
V8 version 11.1.92
I don't know for sure if the Jiterpreter is even being run by this benchmark, but it does seem to improve performance. Running it a second time has similar results, so I'm assuming it is not a fluke caused by differing numbers of has collisions run-to-run. |
You'll need to rebase this now to resolve a conflict (sorry! 🙇♀️), it shouldn't be too hard to do though. The jiterpreter code just got rearranged and split into two files, but copying your work over should be a simple bit of copy-paste. |
9ba8743
to
f1fec31
Compare
f1fec31
to
d648642
Compare
I resolved the merge conflicts and the tests pass. |
Great! I'll make sure we're cool adding this (I don't see any problems) and get it merged. |
Thank you for your contribution! 🎉 |
#80520 added support in the Jiterpreter for the intrinsic that underlies
RuntimeHelpers.GetHashCode
. This PR adds similar support for the intrinsic that underliesRuntimeHelpers.TryGetHashCode
.For reference
RuntimeHelpers.TryGetHashCode
was added in #80059. It is currently only used inConditionalWeakTable.TryGetValue
.Testing