haskell-unordered-containers / unordered-containers

Efficient hashing-based container types
BSD 3-Clause "New" or "Revised" License
222 stars 97 forks source link

[WIP] Use unboxed sums for change / no-change tracking #461

Open sjakobi opened 2 years ago

sjakobi commented 2 years ago

…instead of pervasive ptrEq.

sjakobi commented 2 years ago

With the benchmarks I'm getting a lot of noise and a rather reliable 2-3% speedup in HashMap.insert-dup.ByteString.

treeowl commented 2 years ago

The last time I experimented with this idea, the performance was worse, but maybe things have changed. Or maybe there are differences between HashMap and Map that explain the difference.

treeowl commented 2 years ago

FWIW, I think those old experiments used unboxed tuples with Int# tags rather than the (then bleeding edge) unboxed sums, but I don't know why that would make a difference, considering the way GHC implements unboxed sums.