Skip to content

Commit

Permalink
[MemProf] Switch to DenseMap for performance (NFC) (llvm#81035)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
teresajohnson authored Feb 7, 2024
1 parent c95693c commit bb3ea6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/include/llvm/IR/ModuleSummaryIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ class ModuleSummaryIndex {

// 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>;
Expand Down

0 comments on commit bb3ea6c

Please sign in to comment.