-
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
Fix the multicore performance of mapping from an instruction pointer to a MethodDesc #79021
Conversation
- This is improving docs on the old scheme - Also remove the ngen specific logic
- still with the wrong locking though...
…the collectible handling characteristics
Nice! Does it make |
@EgorBo, yes, I do expect that this will make IsReadyToRun very cheap. (Probably 5-6 memory loads from separate pages plus some math, so repeated calls should be extremely cheap, and random calls will be somewhat expensive, but not bad.) The implementation as written has a risk of entering a lock under some circumstances, but after sleeping on it, I think we could get rid of that for the IsReadyToRun logic, and be assured that IsReadyToRun is cheap. What do you think you can optimize? |
I'd like to sort of de-prioritize R2R'd code for tier1 promotion in favor of non R2R'd one. |
Now that it is profileable, there are tweaks to be made
@EgorBo, fyi, |
- Implement a fast path for determining that an instruction pointer is a FixupPrecode/StubPrecode. It turns out those are more likely, than actual jitted code (as we typically have wrapper stubs of some form at this point). - Implement a fast path for computing the number of arguments to a method instead of using MetaSig. - Remove fancy locking scheme from RangeSectionMap. The existing fancy locking scheme works fine. - Fix bug in ExecutionManager::IsReadyToRun and ExecutionManager::FindReadyToRunModule where locks were not used
…elying on [,) semantics and some were [,]
- Use the byte array trick to remove unneeded dereferences.
…onger used after code is collected
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 modulo feedback. Nice work!
Mapping from an instruction pointer to a MethodDesc is a critical component of the runtime used in many places, notably diagnostics, slow path delegate creation, and stackwalking.
This change provides a dramatic improvement in the performance of that logic through several techniques.
Performance of this was tested in both the EH stackwalking scenario as well as the delegate slow path creation scenario, but the delegate logic is what will be most visible when this is checked in. (See PR #79471 for details of the additional changes necessary to take advantage of this work when doing EH) (#8393 describes the potential product impact of just improving the delegate slow path creation code)
For the delegate creation scenario the perf impact was measured to be quite substantial. These numbers are in ms to create a constant number of delegates on each thread used. Smaller is better. The test was run on a 6 core machine.
Fixes #8393
Replaces the controversial logic in PR #68607