Skip to content

Conversation

@shekhirin
Copy link
Contributor

@shekhirin shekhirin commented Jun 24, 2025

Benchmark hashing using default hasher and foldhash.

shekhirin and others added 3 commits June 24, 2025 11:55
- Add foldhash dependency for fast hash function benchmarking
- Add bench_hash function to bench.rs with three test scenarios:
  - Direct hash computation with FoldHasher
  - HashMap insertion performance
  - HashMap lookup performance
- Include hash benchmarks in criterion group

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@codspeed-hq
Copy link

codspeed-hq bot commented Jun 24, 2025

CodSpeed Performance Report

Merging #27 will degrade performances by 19.16%

Comparing bench-improvements (acd92c8) with main (53ed266)

Summary

⚡ 13 improvements
❌ 14 regressions
✅ 84 untouched benchmarks
🆕 24 new benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
common_prefix_length[16] 213.6 ns 242.8 ns -12.01%
common_prefix_length[8] 213.6 ns 242.8 ns -12.01%
ends_with[64] 342.2 ns 402.2 ns -14.92%
extend[16] 471.4 ns 354.7 ns +32.89%
extend[32] 467.2 ns 350.6 ns +33.28%
extend[8] 474.2 ns 357.5 ns +32.63%
get_byte_unchecked[16] 250.3 ns 279.4 ns -10.44%
get_byte_unchecked[8] 194.7 ns 223.9 ns -13.03%
🆕 default[16] N/A 619.7 ns N/A
🆕 default[32] N/A 619.7 ns N/A
🆕 default[64] N/A 619.7 ns N/A
🆕 default[8] N/A 619.7 ns N/A
🆕 foldhash[16] N/A 337.8 ns N/A
🆕 foldhash[32] N/A 337.8 ns N/A
🆕 foldhash[64] N/A 337.8 ns N/A
🆕 foldhash[8] N/A 337.8 ns N/A
🆕 insert_default[16] N/A 42.1 µs N/A
🆕 insert_default[32] N/A 42.5 µs N/A
🆕 insert_default[64] N/A 42.6 µs N/A
🆕 insert_default[8] N/A 42.1 µs N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@shekhirin shekhirin changed the title bench: hash with foldhash bench: hashing Jun 24, 2025
@shekhirin shekhirin changed the title bench: hashing bench: Hash Jun 24, 2025
shekhirin and others added 2 commits June 24, 2025 13:13
Benchmarks both default and foldhash hashers for comprehensive HashMap performance testing:
- insert_default: HashMap insertion with default hasher
- insert_foldhash: HashMap insertion with foldhash
- lookup_default: HashMap lookup with default hasher
- lookup_foldhash: HashMap lookup with foldhash

Results show foldhash is ~2.4x faster for insertion and ~2.1x faster for lookup operations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
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