-
Notifications
You must be signed in to change notification settings - Fork 5k
Stub Precode variant for DynamicHelpers #113402
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: @mangod9 |
/cc @dotnet/area-type-system-and-startup |
…porting to Unix assembly code)
…ble function pointer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
…minate the stub heap with stuff that will become unused as tiered compilation does its work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will work for iOS and the startup improvement is nice side-effect. I don't see how it is going to work for wasm and potentially other architectures where low-level tricks like this are not possible.
As I have mentioned offline, we may want to use fixups that run before the method executes as the most portable solution. I expect that it would come with similar startup improvement as side-effect, and it would have a lot less arch-specific code.
@jkotas I agree, although I also see ways to make this work in wasm (with some unfortunate bloat in file size). I suspect that just dealing with fixups will be fundamentally better for most paths in wasm, and probably even for iOS, but this path will work well in the short term, and didn't require any significant refactorings (and thus was surprisingly cheap to implement). |
Run DynamicHelpers logic with StubPrecodes instead of dynamically generating the stubs.
Performance measurements indicate that this path is about 1% faster than the current approach for startup of my powershell benchmark, and results seem similar between X64 and Arm64 which was a surprise to me. Throughput results look like roughly a wash. I'd like to merge this PR in with its current state of changing all Arm64 and X64 behavior to use the new path to get a full set of performance data, as it appears this might just be a better approach than generating stubs dynamically.