From 6495cb5f2cc738236bdeed0f43fea450afe8fc06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 5 Feb 2025 22:25:43 +0100 Subject: [PATCH] Adjust benchmark --- hashstructure_test.go | 44 ++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/hashstructure_test.go b/hashstructure_test.go index e7106f7..f0259e1 100644 --- a/hashstructure_test.go +++ b/hashstructure_test.go @@ -779,27 +779,29 @@ func TestHash_golden(t *testing.T) { func BenchmarkMap(b *testing.B) { m := map[string]any{ - "a": "b", - "c": "d", - "e": "f", - "g": "h", - "i": "j", - "k": "l", - "m": "n", - "o": "p", - "q": "r", - "s": "t", - "nested": map[string]string{ - "a": "b", - "c": "d", - "e": "f", - "g": "h", - "i": "j", - "k": "l", - "m": "n", - "o": "p", - "q": "r", - "s": "t", + "int16": int16(42), + "int32": int32(42), + "int64": int64(42), + "int": int(42), + "uint16": uint16(42), + "uint32": uint32(42), + "uint64": uint64(42), + "uint": uint(42), + "float32": float32(42), + "float64": float64(42), + "complex64": complex64(42), + "complex128": complex128(42), + "string": "foo", + "bool": true, + "slice": []string{"foo", "bar"}, + "sliceint": []int{1, 2, 3}, + "map": map[string]string{"foo": "bar"}, + "struct": struct { + Foo string + Bar []interface{} + }{ + Foo: "foo", + Bar: []interface{}{nil, nil, nil}, }, }