Conversation
… countin…" This reverts commit 7756d81.
|
Tagging subscribers to this area: @agocke |
There was a problem hiding this comment.
Pull request overview
This PR reverts #124664 to address a reported 12–13% NuGet restore performance regression attributed to increased time in ThePreStub (notably RtlEnterCriticalSection). The revert restores the call-counting approach that uses per-method forwarder precodes for methods that participate in vtable slot backpatching, rather than reusing the method’s temporary-entrypoint precode for call-counting indirection.
Changes:
- Restore forwarder-stub-based call counting for methods that may have entry point slots to backpatch (virtual/interface methods under slot backpatching).
- Revert related invariants/documentation around temporary entry point backpatching and call counting behavior.
- Add tracking/cleanup logic for forwarder stubs (hash table, reset, and trimming), and a small inlining annotation tweak in
method.cpp.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/coreclr/vm/prestub.cpp | Reverts the detailed call-counting/temporary-entrypoint explanation back to the simpler invariant description for vtable-slot-backpatchable methods. |
| src/coreclr/vm/method.cpp | Marks MethodDesc::TryBackpatchEntryPointSlots as FORCEINLINE. |
| src/coreclr/vm/callcounting.h | Updates the design comment to describe forwarder precodes for backpatchable methods; adds a forwarder-stub hash member/traits. |
| src/coreclr/vm/callcounting.cpp | Reintroduces forwarder-stub allocation/use for backpatchable methods, plus reset/removal/trimming logic for the forwarder-stub hash. |
|
Something like this also showed up in our perf benchmarks but for some reason the triaging process is taking a long time to report it back.
#124664 is in the implicated range here. |
|
@DrewScoggins for perf results delay |
…l counting indirection" (dotnet#125285) This reverts commit 5db8084.

Reverts #124664
This appears to have caused a 12-13% regression nuget restore perf due to increased time spent in ThePreStub, specifically in RtlEnterCriticalSection