3 ms·
Double jaw-drop. First when the (dynamic) match was slower than the hash map, second when sort_unstable was faster than the hash map! Cool article. It's clear
by Epa095 1y ago
Double jaw-drop. First when the (dynamic) match was slower than the hash map, second when sort_unstable was faster than the hash map!
Cool article. It's clear that all my theoretical algorithm-knowledge comes short when faced with real CPUs.
- fpoling 1y agoChromium recommends to use flat_map, a map-like interface based on a sorted array, for data structures facing GUI or similar when the number of items in the map is naturally bounded. It is faster and more compact compared with hash maps.
- Voultapher 1y agoA looong time ago I wrote my first blog post - on a now defunct website - about a VecMap where I did exactly that. Sort when needed and full flat array. That said flat_map as coined by Google is an acronym for swiss tables. See [1]. I.e. exactly what Rust's standard library `HashMap` is, also the one being tested here. [1] https://github.com/abseil/abseil-cpp/blob/23b9b75217721040f5a2d073b8ef3014486ef5b7/absl/container/flat_hash_map.h#L19 https://github.com/abseil/abseil-cpp/blob/23b9b75217721040f5...
- Voultapher 1y agoYour comment made my day, thank you.