Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

Commit

Permalink
add simple benchmark for strcrc32 hash
Browse files Browse the repository at this point in the history
  • Loading branch information
maxim-konovalov committed Feb 28, 2024
1 parent cc56a6f commit 527364f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vshard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,9 @@ func TestRouterBucketIDStrCRC32(t *testing.T) {
require.Equal(t, uint64(103202), BucketIDStrCRC32("2707623829", uint64(256000)))
require.Equal(t, uint64(35415), BucketIDStrCRC32("2706201716", uint64(256000)))
}

func BenchmarkRouterBucketIDStrCRC32(b *testing.B) {
for i := 0; i < b.N; i++ {
BucketIDStrCRC32("test_bench_key", uint64(256000))
}
}

0 comments on commit 527364f

Please sign in to comment.