Skip to content

[release/10.0] Improve UnwindInfoTable's performance#126331

Open
eduardo-vp wants to merge 1 commit intodotnet:release/10.0from
eduardo-vp:backport-125545-to-release-10.0
Open

[release/10.0] Improve UnwindInfoTable's performance#126331
eduardo-vp wants to merge 1 commit intodotnet:release/10.0from
eduardo-vp:backport-125545-to-release-10.0

Conversation

@eduardo-vp
Copy link
Copy Markdown
Member

@eduardo-vp eduardo-vp commented Mar 30, 2026

Backport of #125545 to release/10.0

Place the entries of UnwindInfoTable in a buffer and flush such that we amortize the cost of the operations (pRtlAddGrowableFunctionTable + pRtlDeleteGrowableFunctionTable) to create the internal table of RUNTIME_FUNCTIONs.

Customer Impact

  • Customer reported
  • Found internally

Regression was reported in #123124.

Regression

  • Yes
  • No

Testing

Tested with the following test case in #123124 (comment) and execution time was reduced in 50%. Also, all tests in CI passed.

Risk

Medium. The change affects x64 windows programs and the changes are not trivial.

Place the entries of UnwindInfoTable in a buffer and flush such that we amortize the cost of the operations (pRtlAddGrowableFunctionTable + pRtlDeleteGrowableFunctionTable) to create the internal table of `RUNTIME_FUNCTION`s.

Contributes to dotnet#123124.

---------

Co-authored-by: Eduardo Velarde <evelardepola@microsoft.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.

@eduardo-vp eduardo-vp added the Servicing-consider Issue for next servicing release review label Mar 30, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Backport to release/10.0 of a CoreCLR performance improvement that reduces overhead when publishing Windows x64 unwind info by buffering and batch-flushing entries to amortize growable function table operations.

Changes:

  • Introduces a per-UnwindInfoTable pending buffer and FlushPendingEntries() to batch-merge/publish unwind entries.
  • Splits the single unwind-info lock into separate publish vs. pending-buffer locks to reduce contention.
  • Updates CRST type definitions/generated mappings and adjusts method/parameter naming for clarity.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/coreclr/vm/codeman.h Updates UnwindInfoTable API and adds pending-buffer/flush members.
src/coreclr/vm/codeman.cpp Implements buffered publishing, new lock strategy, and merge/flush logic.
src/coreclr/inc/CrstTypes.def Replaces the old unwind-info CRST with publish/pending CRSTs and ordering.
src/coreclr/inc/crsttypes_generated.h Regenerates CRST enum/name/level maps for the new lock types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-VM-coreclr Servicing-consider Issue for next servicing release review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants