summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/interface
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-04-11 14:06:54 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-04-11 14:06:54 +0000
commit2335a5cb853c596ee44bae7fdaf7c2e9f2fd3b44 (patch)
treed3b8d1a50c829386172b480e8dfdf1b7a77378ad /lldb/scripts/Python/interface
parent63057a5ff08e749543a5e901e8bc22909f014735 (diff)
downloadbcm5719-llvm-2335a5cb853c596ee44bae7fdaf7c2e9f2fd3b44.tar.gz
bcm5719-llvm-2335a5cb853c596ee44bae7fdaf7c2e9f2fd3b44.zip
Cache the hash value of the operands in the MDNode.
FoldingSet is implemented as a chained hash table. When there is a hash collision during insertion, which is common as we fill the table until a load factor of 2.0 is hit, we walk the chained elements, comparing every operand with the new element's operands. This can be very expensive if the MDNode has many operands. We sacrifice a word of space in MDNode to cache the full hash value, reducing compares on collision to a minimum. MDNode grows from 28 to 32 bytes + operands on x86. On x86_64 the new bits fit nicely into existing padding, not growing the struct at all. The actual speedup depends a lot on the test case and is typically between 1% and 2% for C++ code with clang -c -O0 -g. llvm-svn: 154497
Diffstat (limited to 'lldb/scripts/Python/interface')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud