4 ms·
I feel I missed point of this article. I thought the author is trying to prove that b-tren isn't that bad compared to hashmaps. But taking 2~3x longer looks pre
by nialv7 2y ago
I feel I missed point of this article. I thought the author is trying to prove that b-tren isn't that bad compared to hashmaps. But taking 2~3x longer looks pretty bad.
If I need predictable ordering (but not actually sorting the keys) I will use something like indexmap, not b-tree.
- magicalhippo 2y agoThe point seems to be the author found very different estimates of just how much worse b-trees would be. As the author notes, hashmaps have some less desirable properties as well. So the author ran some benchmarks to find out, and ended with the following conclusion: Overall, I'm unconvinced that it's worth exploring btrees further. I'll stick to hashmaps and I'll either iterate in insertion order or I'll require sorting entries before iterating.