3 ms·
> the [std::unordered_map] hash map needs 1 malloc() call per entry. This is a key reason why std::unordered_map is several times slower than fast hashmap impl
by attractivechaos 3y ago
> the [std::unordered_map] hash map needs 1 malloc() call per entry.
This is a key reason why std::unordered_map is several times slower than fast hashmap implementations that only use a couple of long flat arrays per hashmap object. Nonetheless, common STL implementations use their own allocators by default and would not call malloc() on small objects frequently.