Skip to content

[cDAC] Merge metadata ranges for faster dump filtering - #136600

Merged
max-charlamb merged 3 commits into
dotnet:mainfrom
max-charlamb:cdac-merge-metadata-ranges
Nov 2, 2026
Merged

max-charlamb merged 3 commits into
dotnet:mainfrom
max-charlamb:cdac-merge-metadata-ranges

Conversation

@max-charlamb

@max-charlamb max-charlamb commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Summary

Replace the linear scan of registered metadata spans in MemoryRegionEmitter with a sorted interval set backed by a list.

Performance

Windows x64 Release NativeAOT mean heap-memory enumeration time, excluding dump writing:

Heap workload cDAC before cDAC (List<T>.BinarySearch) cDAC (handwritten binary search)
DeepStacks 66.388 ms 69.361 ms 59.529 ms
CodeHeavy 12.531 ms 12.620 ms 12.241 ms

The original linear-scan baseline is from the initial 10-sample screening. The binary-search columns are from the later balanced rerun with 180 samples per implementation/workload and reversed execution order. These are separate measurement batches on a shared VM; timings remain order-sensitive.

Note

This description was prepared with GitHub Copilot.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: de3eab4e-b090-430a-8e30-6b204fb1519a
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

Replace the handwritten upper-bound search with List.BinarySearch. Use the maximum tuple end to include equal starts, and decode the insertion position to find the preceding range.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: de3eab4e-b090-430a-8e30-6b204fb1519a
This reverts commit 9ae86ee.

Restore the handwritten upper-bound search after profiling showed higher total metadata-lookup CPU with List.BinarySearch.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: de3eab4e-b090-430a-8e30-6b204fb1519a
@max-charlamb

Copy link
Copy Markdown
Member Author

/ba-g previous CI run on 3431c73 passed

@max-charlamb
max-charlamb merged commit 1011b2d into dotnet:main Nov 2, 2026
22 of 68 checks passed
@max-charlamb
max-charlamb deleted the cdac-merge-metadata-ranges branch November 2, 2026 19:51
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants