Skip to content

UPSTREAM PR #1996: Add flat_hash_map benchmarks#9

Open
loci-dev wants to merge 1 commit into
mainfrom
loci/pr-1996-add-flat-hash-map-benchmark
Open

UPSTREAM PR #1996: Add flat_hash_map benchmarks#9
loci-dev wants to merge 1 commit into
mainfrom
loci/pr-1996-add-flat-hash-map-benchmark

Conversation

@loci-dev
Copy link
Copy Markdown

@loci-dev loci-dev commented Feb 8, 2026

Note

Source pull request: abseil/abseil-cpp#1996

Adds benchmark suite for absl::flat_hash_map, the recommended default hash map that previously had no public benchmarks.

Benchmarks included:

  • Basic operations (insert, lookup hit/miss) for int and string keys
  • Load factor analysis at 25%, 50%, 75%, and 87% capacity
  • Iteration performance at different load factors
  • Reserve vs no-reserve comparison across multiple sizes

Key findings from benchmark results:

  • reserve() provides 20-24% performance improvement for known sizes
  • Load factor has minimal impact on lookup speed (~2.1-2.2M ops/sec)
  • Higher load factors improve iteration by 30% (better cache locality)
  • Failed lookups are 50% faster than successful lookups

Testing: All benchmarks compile and run successfully with Bazel.

Adds benchmark suite for absl::flat_hash_map, the recommended default
hash map that previously had no public benchmarks.

Benchmarks included:
- Basic operations (insert, lookup hit/miss) for int and string keys
- Load factor analysis at 25%, 50%, 75%, and 87% capacity
- Iteration performance at different load factors
- Reserve vs no-reserve comparison across multiple sizes

Key findings from benchmark results:
- reserve() provides 20-24% performance improvement for known sizes
- Load factor has minimal impact on lookup speed (~2.1-2.2M ops/sec)
- Higher load factors improve iteration by 30% (better cache locality)
- Failed lookups are 50% faster than successful lookups

Testing: All benchmarks compile and run successfully with Bazel.
@loci-dev loci-dev force-pushed the main branch 6 times, most recently from ff8c029 to ca66ac4 Compare February 15, 2026 06:45
@loci-dev loci-dev force-pushed the main branch 5 times, most recently from f5bee42 to 62a7c36 Compare February 24, 2026 06:46
@loci-dev loci-dev force-pushed the main branch 8 times, most recently from 558fc6f to 6688b18 Compare March 5, 2026 06:45
@loci-dev loci-dev force-pushed the main branch 4 times, most recently from 7f52e96 to b369cbc Compare March 12, 2026 06:45
@loci-dev loci-dev force-pushed the main branch 5 times, most recently from 386f549 to df20b95 Compare March 19, 2026 06:46
@loci-dev loci-dev force-pushed the main branch 5 times, most recently from 453eac7 to 951ff86 Compare March 27, 2026 06:50
@loci-dev loci-dev force-pushed the main branch 5 times, most recently from 9fc2ee5 to 58c0402 Compare April 4, 2026 06:46
@loci-dev loci-dev force-pushed the main branch 5 times, most recently from 1707ef1 to cde405e Compare April 11, 2026 06:46
@loci-dev loci-dev force-pushed the main branch 3 times, most recently from 3f337f5 to e94d936 Compare April 21, 2026 06:10
@loci-dev loci-dev force-pushed the main branch 3 times, most recently from 1c2844b to 7abb8d9 Compare April 25, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants