From c6a58060aba3f4ccf740b99ba7e25a0e6034162c Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Wed, 7 Feb 2024 12:09:29 -0800 Subject: [PATCH] [MemProf] Switch to DenseMap for performance (NFC) 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. --- llvm/include/llvm/IR/ModuleSummaryIndex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/include/llvm/IR/ModuleSummaryIndex.h b/llvm/include/llvm/IR/ModuleSummaryIndex.h index 395c9e332eb8f..d5ff15063671d 100644 --- a/llvm/include/llvm/IR/ModuleSummaryIndex.h +++ b/llvm/include/llvm/IR/ModuleSummaryIndex.h @@ -1377,7 +1377,7 @@ class ModuleSummaryIndex { // Temporary map while building StackIds list. Clear when index is completely // built via releaseTemporaryMemory. - std::map StackIdToIndex; + DenseMap StackIdToIndex; // YAML I/O support. friend yaml::MappingTraits;