Performance optimization on ImmutableMap/ImmutableSet:
authorTed Kremenek <kremenek@apple.com>
Tue, 30 Nov 2010 20:26:45 +0000 (20:26 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 30 Nov 2010 20:26:45 +0000 (20:26 +0000)
commit75627d3d2e700b8fa0e040a5ec4ef1a0e299b9b5
tree94bb38eeb9f5e098e0550d8787b459b628596b4b
parentf619b5a665f9972cde28f14e7b94b51502104b15
Performance optimization on ImmutableMap/ImmutableSet:

- Use a DenseSet instead of a FoldingSet to cache
canonicalized nodes.  This reduces the overhead
of double-hashing.

- Use reference counts in ImutAVLTree to much
more aggressively recover tree nodes that are
no longer usable.  We can generate many
transient nodes while using add() and remove()
on ImmutableSet/ImmutableMaps to generate a final
set/map.

For the clang static analyzer (the main client
of these data structures), this results in
a slight speedup (0.5%) when analyzing sqlite3,
but much more importantly results in a 30-60%
reduction in peak memory usage when the analyzer
is analyzing a given function in a file.  On
average that's about a ** 44% reduction ** in the
memory footprint of the static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120459 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/ImmutableMap.h
include/llvm/ADT/ImmutableSet.h