aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorDawid Jurczak <dawid_jurek@vp.pl>2022-02-08 17:23:53 +0100
committerDawid Jurczak <dawid_jurek@vp.pl>2022-02-08 17:54:04 +0100
commit5d8d3a11c4d4ed8bb610f60f8fa37b8043a40acd (patch)
tree5aae4670b975ecb26fa69acbbb78ddeceab954f9 /clang/lib/Frontend/InitPreprocessor.cpp
parent78eeda7529e73b936dd46ac640756d8032bcc48b (diff)
downloadllvm-5d8d3a11c4d4ed8bb610f60f8fa37b8043a40acd.zip
llvm-5d8d3a11c4d4ed8bb610f60f8fa37b8043a40acd.tar.gz
llvm-5d8d3a11c4d4ed8bb610f60f8fa37b8043a40acd.tar.bz2
[NFC] Increase initial size of FoldingSets used in ASTContext and CodeGenTypes
Among many FoldingSet users most notable seem to be ASTContext and CodeGenTypes. The reasons that we spend not-so-tiny amount of time in FoldingSet calls from there, are following: 1. Default FoldingSet capacity for 2^6 items very often is not enough. For PointerTypes/ElaboratedTypes/ParenTypes it's not unlikely to observe growing it to 256 or 512 items. FunctionProtoTypes can easily exceed 1k items capacity growing up to 4k or even 8k size. 2. FoldingSetBase::GrowBucketCount cost itself is not very bad (pure reallocations are rather cheap thanks to BumpPtrAllocator). What matters is high collision rate when lot of items end up in same bucket slowing down FoldingSetBase::FindNodeOrInsertPos and trashing CPU cache (as items with same hash are organized in intrusive linked list which need to be traversed). This change address both issues by increasing initial size of FoldingSets used in ASTContext and CodeGenTypes. Extracted from: https://reviews.llvm.org/D118385 Differential Revision: https://reviews.llvm.org/D118608
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
0 files changed, 0 insertions, 0 deletions