-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[clr-interp] Improve the performance of interpreter calls #120067
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
[clr-interp] Improve the performance of interpreter calls #120067
Conversation
- Instead of setting the target in the CallStubHeader at each invocation, store the target in the CallStubHeader immediately. - Avoid invoking the prestub unnecessarily. Instead, detect that we've already run the prestub to completion at least once before poisoning the m_interpreterCode field on MethodDesc. This may be enough to make some of our tests which are currently timing out pass.
|
Tagging subscribers to this area: @mangod9 |
|
/azp run runtime-interpreter |
|
Azure Pipelines successfully started running 1 pipeline(s). |
… were not quite ready to execute.
…_InterpreterMethodCallPerf
|
/azp run runtime-interpreter |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Pull Request Overview
This PR optimizes interpreter call performance by reducing redundant work and avoiding unnecessary prestub invocations. The changes focus on storing call targets in CallStubHeader immediately rather than setting them at each invocation, and implementing a poisoning mechanism to prevent repeated failed attempts to get interpreter code.
- Store call targets in CallStubHeader at creation time to avoid repeated target setting
- Add poisoning mechanism to prevent redundant prestub calls for methods that cannot be interpreted
- Optimize call paths by detecting when prestub has already completed successfully
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/coreclr/vm/wasm/helpers.cpp | Updates InvokeManagedMethod to handle NULL target by getting multi-callable address |
| src/coreclr/vm/method.hpp | Adds interpreter code poisoning mechanism with new methods and constants |
| src/coreclr/vm/interpexec.cpp | Major optimization changes including target storage in CallStubHeader and poisoning logic |
| src/coreclr/vm/callstubgenerator.h | Adds GetTarget() method to CallStubHeader for retrieving stored targets |
This may be enough to make some of our tests which are currently timing out pass.