[MemProf][NFC] Switch to DenseMaps (#93868)

Change a couple of maps from std::map to DenseMap, which showed
a modest (3.6%) reduction in peak RSS.
This commit is contained in:
Teresa Johnson 2024-05-30 12:57:14 -07:00 committed by GitHub
parent ce7b670912
commit 61afebdacc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -552,13 +552,13 @@ private:
const DenseSet<uint32_t> &AllocContextIds);
/// Map from each context ID to the AllocationType assigned to that context.
std::map<uint32_t, AllocationType> ContextIdToAllocationType;
DenseMap<uint32_t, AllocationType> ContextIdToAllocationType;
/// Identifies the context node created for a stack id when adding the MIB
/// contexts to the graph. This is used to locate the context nodes when
/// trying to assign the corresponding callsites with those stack ids to these
/// nodes.
std::map<uint64_t, ContextNode *> StackEntryIdToContextNodeMap;
DenseMap<uint64_t, ContextNode *> StackEntryIdToContextNodeMap;
/// Maps to track the calls to their corresponding nodes in the graph.
MapVector<CallInfo, ContextNode *> AllocationCallToContextNodeMap;