Skip to content

UPSTREAM PR #1996: Add flat_hash_map benchmarks#4

Open
loci-dev wants to merge 1 commit intomasterfrom
upstream-PR1996-branch_lihasgupta-add-flat-hash-map-benchmark
Open

UPSTREAM PR #1996: Add flat_hash_map benchmarks#4
loci-dev wants to merge 1 commit intomasterfrom
upstream-PR1996-branch_lihasgupta-add-flat-hash-map-benchmark

Conversation

@loci-dev
Copy link

Mirrored from 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-review
Copy link

loci-review bot commented Jan 18, 2026

Explore the complete analysis inside the Version Insights

@loci-dev loci-dev force-pushed the master branch 3 times, most recently from 4069466 to bba4b70 Compare January 22, 2026 21:03
@loci-dev loci-dev force-pushed the master branch 5 times, most recently from 52f69b0 to 21afa7e Compare February 1, 2026 23:03
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