Skip to content

Commit bb3ea6c

Browse files
[MemProf] Switch to DenseMap for performance (NFC) (llvm#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.
1 parent c95693c commit bb3ea6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/IR/ModuleSummaryIndex.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@ class ModuleSummaryIndex {
13771377

13781378
// Temporary map while building StackIds list. Clear when index is completely
13791379
// built via releaseTemporaryMemory.
1380-
std::map<uint64_t, unsigned> StackIdToIndex;
1380+
DenseMap<uint64_t, unsigned> StackIdToIndex;
13811381

13821382
// YAML I/O support.
13831383
friend yaml::MappingTraits<ModuleSummaryIndex>;

0 commit comments

Comments
 (0)