3 ms·
that's absolutely untrue in a lot of cases: https://stackoverflow.com/questions/36392583/is-an-unordered-map-really-faster-than-a-map-in-practice https://stacko
by jcelerier 5y ago
that's absolutely untrue in a lot of cases: https://stackoverflow.com/questions/36392583/is-an-unordered-map-really-faster-than-a-map-in-practice https://stackoverflow.com/questions/36392583/is-an-unordered...
of course one can always find faster, drop-in replacement libraries: https://martin.ankerl.com/2019/04/01/hashmap-benchmarks-01-overview/ https://martin.ankerl.com/2019/04/01/hashmap-benchmarks-01-o...
e.g. replacing std::unordered_map with robin_hood::hash_map makes the above C++ code go from 1.2 seconds to 0.5 seconds on my machine (std::map is around 1.3/1.4 seconds for libstdc++).
(though as others said, this test is in big part a test of std::string performance... replacing strings by int make times go down to ~0.1s here)