diff --git a/internal/ttlcache/utils_test.go b/internal/ttlcache/utils_test.go index 5f9c88f..7d395e9 100644 --- a/internal/ttlcache/utils_test.go +++ b/internal/ttlcache/utils_test.go @@ -1,6 +1,7 @@ package ttlcache import ( + "github.com/cespare/xxhash/v2" "runtime" "testing" ) @@ -11,3 +12,10 @@ func BenchmarkHashKey(b *testing.B) { HashKey([]byte("HELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLD")) } } + +func BenchmarkHashKey2(b *testing.B) { + runtime.GOMAXPROCS(1) + for i := 0; i < b.N; i++ { + xxhash.Sum64String("HELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLD") + } +}