From 389f7e907adb4d0723c6d609e00e4522ceef714d Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Wed, 16 Jan 2019 01:14:35 +0100 Subject: extend benchmarks --- internal/hash/hash_func_test.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'internal/hash/hash_func_test.go') diff --git a/internal/hash/hash_func_test.go b/internal/hash/hash_func_test.go index 15919c3..a021ad8 100644 --- a/internal/hash/hash_func_test.go +++ b/internal/hash/hash_func_test.go @@ -28,8 +28,16 @@ func TestDefaultHash(t *testing.T) { } func BenchmarkDefaultHash(b *testing.B) { - key := []byte("THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG") - for i := 0; i < b.N; i++ { - defaultHash(key) + benchCases := []string{ + "A", + "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG", + } + for _, bc := range benchCases { + b.Run(bc, func(b *testing.B) { + key := []byte(bc) + for i := 0; i < b.N; i++ { + defaultHash(key) + } + }) } } -- cgit v1.2.3