Hacker News new | ask | show | jobs
by stochastic_monk 2944 days ago
This is getting deep into some wizardry, but if you used a custom pool-like allocator you could group contents close together in cache, and, if necessary/appropriate, even rearrange the elements in the container to be more cache-friendly for your purposes.
2 comments

You could, but the premise of using a tree was to avoid unpredictable rehashing latency, if you start compacting the tree every now and then, you basically pay the same price.
That approach tastes rather like a copying+compacting garbage-collector.