[MemProf] Switch to DenseMap for performance (NFC) (#81035)

Some profiling showed that the accesses to this map during bitcode
reading was incurring over 10% of the time in a large thin link. There
is no need for it to be std::map, and I measured around 8.5% time
reduction in the same thin link from switching to DenseMap.
This commit is contained in:
Teresa Johnson 2024-02-07 13:32:08 -08:00 committed by GitHub
parent c95693c746
commit bb3ea6c810
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1377,7 +1377,7 @@ private:
// Temporary map while building StackIds list. Clear when index is completely
// built via releaseTemporaryMemory.
std::map<uint64_t, unsigned> StackIdToIndex;
DenseMap<uint64_t, unsigned> StackIdToIndex;
// YAML I/O support.
friend yaml::MappingTraits<ModuleSummaryIndex>;