Hasty Briefsbeta

Bilingual

An Extensive Benchmark of C and C++ Hash Tables

19 hours ago
  • #performance
  • #hash-tables
  • #benchmarking
  • The article presents a benchmarking suite for hash tables in C and C++, addressing gaps in existing benchmarks.
  • Three hash table configurations are tested: 32-bit integer key with 32-bit value, 64-bit integer key with 448-bit value, and 16-char c-string key with 64-bit value.
  • Benchmarks include insertion, erasure, replacement, and lookup operations, with performance measured across varying load factors.
  • Results highlight the performance of various hash tables, including absl::flat_hash_map, ankerl::unordered_dense, boost::unordered_flat_map, and Verstable.
  • Key findings show that SIMD and hybrid open-addressing/separate-chaining tables perform well under high load factors, while node-based separate-chaining tables are slower.
  • The article concludes with recommendations for choosing hash tables based on specific use cases and performance requirements.