Skip to content

[cDAC] Cache resolved code range sections - #136598

Merged
max-charlamb merged 1 commit into
dotnet:mainfrom
max-charlamb:cdac-cache-resolved-code-ranges
Oct 28, 2026
Merged

max-charlamb merged 1 commit into
dotnet:mainfrom
max-charlamb:cdac-cache-resolved-code-ranges

Conversation

@max-charlamb

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

Copy link
Copy Markdown
Member

Cache instruction-pointer-to-range-section resolutions in ExecutionManagerCore and retain the resolved section in each CodeBlock. This avoids repeating range-map traversal for code classification, unwind information, and related queries.

Clear both caches on every target flush. Cache successful resolutions only, preserving existing lookup behavior for misses. Update the EE, interpreter, and ReadyToRun code-block construction sites together.

Performance

This is an isolated change against the same unoptimized cDAC at 9f06f271b8aa0cbb073b2bb6f85b16da576e6eaa, without caller-context reuse or the other enumerator optimizations.

Enumeration-only BenchmarkDotNet comparison over the same six immutable full snapshots. Each invocation uses a fresh enumerator; activation, hashing, coverage checks, and cleanup are outside timing. This does not measure copying heap contents or writing a dump.

Windows x64 Hyper-V VM, AMD EPYC 7763, Release NativeAOT, SDK 11.0.100-rc.2.26504.105. Three launches, five warmups, thirty actual iterations per launch: 90 measured samples for each of 54 provider/workload/mode cases.

Workload Mode Native DAC (ms) cDAC before (ms) cDAC after (ms) Time reduction
SmallSimple Mini 1.652 4.123 3.702 10.2%
SmallSimple Heap 1.618 4.467 4.313 3.5%
SmallSimple Triage 1.619 3.633 3.367 7.3%
LargeSimple Mini 1.725 3.908 3.751 4.0%
LargeSimple Heap 1.640 4.691 4.144 11.7%
LargeSimple Triage 1.779 3.734 3.577 4.2%
SmallComplex Mini 3.110 8.897 7.275 18.2%
SmallComplex Heap 3.146 9.747 7.737 20.6%
SmallComplex Triage 3.528 8.860 6.898 22.2%
LargeComplex Mini 9.749 42.475 29.569 30.4%
LargeComplex Heap 9.635 44.166 29.673 32.8%
LargeComplex Triage 11.109 41.924 28.730 31.5%
CodeHeavy Mini 3.334 11.051 8.443 23.6%
CodeHeavy Heap 3.585 12.108 9.697 19.9%
CodeHeavy Triage 3.598 10.482 7.992 23.8%
DeepStacks Mini 11.528 61.155 39.277 35.8%
DeepStacks Heap 11.517 60.792 40.122 34.0%
DeepStacks Triage 11.768 61.752 39.206 36.5%

These are VM measurements. The consistent complex/stack-heavy wins are the motivation; small/simple differences should not be treated as established improvements. Per-case standard deviations and full raw reports are retained locally.

Note

This description was generated with GitHub Copilot.

Cache successful instruction-pointer range resolutions until flush and retain the resolved section in CodeBlock. Reuse it for classification and unwind-related queries across EE, interpreter, and ReadyToRun code. Preserve existing behavior for misses.

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.

@max-charlamb
max-charlamb requested a review from rcj1 October 28, 2026 19:14
@max-charlamb
max-charlamb marked this pull request as ready for review October 28, 2026 19:14
@max-charlamb
max-charlamb enabled auto-merge (squash) October 28, 2026 22:04
@max-charlamb
max-charlamb merged commit 764b788 into dotnet:main Oct 28, 2026
100 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 29, 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