Uh oh!
There was an error while loading. Please reload this page.
Use SHash as DAC instance hash - #125631
Conversation
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
There was a problem hiding this comment.
Pull request overview
This PR replaces the std::unordered_map-based hash table in DacInstanceManager with an SHash-based implementation by removing the #define DAC_HASHTABLE that previously selected the hand-rolled hash table, activating the #else branch which now uses SHash instead of std::unordered_map. This yields a ~9.5x speedup for minidump collection on deep-stack scenarios.
Changes:
- Remove
#define DAC_HASHTABLEand thestd::unordered_map/std::hash_comparebased implementation, replacing it withSHash<DacInstanceSHashTraits> - Update all hash table operations (
Add,Find,Supersede,Flush,ClearEnumMemMarker,DumpAllInstances) to useSHashAPIs (LookupPtr,ReplacePtr,Remove,RemoveAll,Begin/End)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/coreclr/debug/daccess/dacimpl.h | Replace std::unordered_map types with SHash<DacInstanceSHashTraits> and custom traits class |
| src/coreclr/debug/daccess/daccess.cpp | Update all hash operations to SHash API calls |
You can also share your feedback on Copilot code review. Take the survey.
Uh oh!
There was an error while loading. Please reload this page.
hoyosjs
commented
Mar 19, 2026
/ba-g iOS failures are deadletters. |
Replaces the hand-rolled hash table implementation in DacInstanceManager withan
SHashbased implementation. This hash is more efficient for the high volume of find operations the DAC issues when verifying cached cross-process reads. During mini dump collection, DacInstanceManager is the central cache for all memory read from the target process. The hand-rolled hash table used a fixed bucket array that degraded quickly for Find and insertion operations.Measured minidump collection against a repro app with 2.5k frame deep stacks over 50 threads and the speedup was roughly 9.5x.