Table of Contents


This test is practically exactly the same as Find 1-2000 size_t, except that it uses 100 byte long std::string. There are 4000 lookups every 4 inserts, until 100k entries inserts.

Results

Hashes

In Insert & Erase std::string we have evaluated that robin_hood::hash is fastest for 100 byte strings, and this is also the case in this benchmark. libstdc++-v3s performance is a tad slower, FNV1a is very slow.

Hashmaps

Here, the robin_hood::unordered_node_map is the clear winner, only narrowly followed by robin_hood::unordered_flat_map. It can clearly be seen that the 1-byte overhead structure is quite important here: in the 0% lookup success case, the performance is much higher because this byte saves us from a lot of std::string comparison checks.

Not only is robin_hood::unordered_node_map the fastest, it has also quite low peak memory usage, only beaten by tsl::sparse_map. E.g. tsl::robin_map uses more than 3 times as much memory.

Chart

Each entry shows average time for a single find and access operation (if found). The final number is average over all entries.

  1. blue: 0% find success, 100 byte size std::string
  2. orange: 25% find success, 100 byte size std::string
  3. green: 50% find success, 100 byte size std::string
  4. red: 75% find success, 100 byte size std::string
  5. magenta: 100% find success, 100 byte size std::string
88.6ns avg8.80MB88.4ns avg9.00MB79.3ns avg10.2MB77.3ns avg7.51MB76.2ns avg7.69MB73.7ns avg8.93MB72.1ns avg6.70MB70.7ns avg11.7MB68.4ns avg23.5MB67.0ns avg10.5MB66.5ns avg22.7MB66.0ns avg12.1MB64.1ns avg6.58MB53.0ns avg18.1MB48.1ns avg10.3MB46.9ns avg11.2MB45.2ns avg8.54MB44.9ns avg8.53MB44.0ns avg7.72MB41.1ns avg9.46MB40.6ns avg7.01MBstd::unordered_mapboost::unordered_mapemilib1::HashMapphmap::parallel_flat_hash_mapphmap::parallel_node_hash_mapeastl::hash_mapspp::sparse_hash_mapboost::multi_index::hashed_uniqueska::flat_hash_maptsl::hopscotch_maptsl::robin_mapska::bytell_hash_maptsl::sparse_mapfolly::F14ValueMapfolly::F14NodeMapabsl::flat_hash_mapabsl::node_hash_mapphmap::flat_hash_mapphmap::node_hash_maprobin_hood::unordered_flat_maprobin_hood::unordered_node_map90.7ns avg8.79MB90.5ns avg9.10MB81.3ns avg9.49MB78.2ns avg7.42MB77.2ns avg7.74MB76.1ns avg8.93MB71.5ns avg6.46MB71.5ns avg11.8MB70.0ns avg22.3MB69.4ns avg23.5MB68.0ns avg9.46MB67.1ns avg9.21MB66.2ns avg6.48MB53.8ns avg17.4MB49.1ns avg10.2MB46.8ns avg10.2MB46.2ns avg9.90MB45.8ns avg8.45MB45.1ns avg7.70MB43.0ns avg9.49MB42.3ns avg7.05MBstd::unordered_mapboost::unordered_mapemilib1::HashMapphmap::parallel_flat_hash_mapphmap::parallel_node_hash_mapeastl::hash_mapspp::sparse_hash_mapboost::multi_index::hashed_uniquetsl::robin_mapska::flat_hash_maptsl::hopscotch_mapska::bytell_hash_maptsl::sparse_mapfolly::F14ValueMapfolly::F14NodeMapabsl::flat_hash_mapphmap::flat_hash_mapabsl::node_hash_mapphmap::node_hash_maprobin_hood::unordered_flat_maprobin_hood::unordered_node_map101ns avg9.26MB98.8ns avg8.72MB92.6ns avg10.8MB88.6ns avg7.44MB87.2ns avg7.81MB84.0ns avg8.94MB81.5ns avg6.67MB80.7ns avg11.8MB80.2ns avg23.0MB80.1ns avg23.7MB77.6ns avg10.4MB77.3ns avg9.61MB76.6ns avg6.65MB65.4ns avg17.4MB60.2ns avg10.1MB58.4ns avg9.18MB57.6ns avg8.42MB57.6ns avg9.16MB56.4ns avg7.68MB53.1ns avg9.48MB52.3ns avg7.03MBboost::unordered_mapstd::unordered_mapemilib1::HashMapphmap::parallel_flat_hash_mapphmap::parallel_node_hash_mapeastl::hash_mapspp::sparse_hash_mapboost::multi_index::hashed_uniquetsl::robin_mapska::flat_hash_maptsl::hopscotch_mapska::bytell_hash_maptsl::sparse_mapfolly::F14ValueMapfolly::F14NodeMapabsl::flat_hash_mapabsl::node_hash_mapphmap::flat_hash_mapphmap::node_hash_maprobin_hood::unordered_flat_maprobin_hood::unordered_node_map103ns avg8.81MB103ns avg9.00MB93.1ns avg13.8MB89.8ns avg7.21MB89.6ns avg7.74MB86.8ns avg8.99MB84.1ns avg11.8MB82.8ns avg6.92MB82.3ns avg24.1MB82.3ns avg22.8MB80.2ns avg13.8MB79.5ns avg12.0MB77.3ns avg6.50MB62.1ns avg19.2MB59.5ns avg9.45MB58.5ns avg8.42MB58.0ns avg10.0MB57.9ns avg10.2MB57.3ns avg7.75MB56.0ns avg9.50MB55.5ns avg7.03MBstd::unordered_mapboost::unordered_mapemilib1::HashMapphmap::parallel_flat_hash_mapphmap::parallel_node_hash_mapeastl::hash_mapboost::multi_index::hashed_uniquespp::sparse_hash_mapska::flat_hash_maptsl::robin_maptsl::hopscotch_mapska::bytell_hash_maptsl::sparse_mapfolly::F14ValueMapabsl::flat_hash_mapabsl::node_hash_mapphmap::flat_hash_mapfolly::F14NodeMapphmap::node_hash_maprobin_hood::unordered_flat_maprobin_hood::unordered_node_map191ns avg9.08MB189ns avg8.78MB181ns avg10.6MB178ns avg7.39MB177ns avg7.80MB174ns avg8.98MB171ns avg11.7MB171ns avg6.89MB169ns avg22.6MB169ns avg23.8MB168ns avg10.4MB166ns avg12.0MB163ns avg6.53MB151ns avg19.6MB146ns avg9.90MB142ns avg10.3MB141ns avg8.47MB140ns avg8.42MB139ns avg7.67MB138ns avg6.98MB137ns avg9.51MB00.2μ0.4μ0.6μ0.8μboost::unordered_mapstd::unordered_mapemilib1::HashMapphmap::parallel_flat_hash_mapphmap::parallel_node_hash_mapeastl::hash_mapboost::multi_index::hashed_uniquespp::sparse_hash_maptsl::robin_mapska::flat_hash_maptsl::hopscotch_mapska::bytell_hash_maptsl::sparse_mapfolly::F14ValueMapfolly::F14NodeMapabsl::flat_hash_mapphmap::flat_hash_mapabsl::node_hash_mapphmap::node_hash_maprobin_hood::unordered_node_maprobin_hood::unordered_flat_map
robin_hood::hashlibstdc++-v3absl::Hashfolly::hasherFNV1a