[PATCH] D14690: Don't force std::set for SmallSet

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 16 15:22:38 PST 2015


> I just counted (manually) with libc++ and it looks like 5 pointers
> down to 3 pointers, so also 16B savings.
>
> However, `DenseSet` does immediately call malloc for 256B at
> construction time (forgot this until I looked at the code).  So
> you're not actually getting the benefit of small storage.
>
> I think for this to make sense you'd want to use a
> `SmallDenseSet<T, 1>`.  SmallDenseSet doesn't exist yet though.

Well, I wrote the patch because our Map and Set are fairly inconsistent:

MapVector uses DenseMap.
SetVector uses SmallSet which uses std::set.

So they have very different performance characteristics. I could also
just change SetVector directly to use DenseSet. Would that be better?
I went with modifying SmallSet in the hope of one day removing
SmallPtrSet.

Cheers,
Rafael


More information about the llvm-commits mailing list