Commit a2edf04 1 parent 956f915 commit a2edf04 Copy full SHA for a2edf04
File tree 3 files changed +16
-1
lines changed
3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -142,3 +142,16 @@ func BenchmarkHashString(b *testing.B) {
142
142
})
143
143
}
144
144
}
145
+
146
+ func BenchmarkHashMap (b * testing.B ) {
147
+ m := map [string ]interface {}{}
148
+ for i := 0 ; i < 1000 ; i ++ {
149
+ m [fmt .Sprintf ("key%d" , i )] = i
150
+ }
151
+
152
+ b .ResetTimer ()
153
+
154
+ for i := 0 ; i < b .N ; i ++ {
155
+ HashString (m )
156
+ }
157
+ }
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ require (
36
36
github.com/gobuffalo/flect v1.0.3
37
37
github.com/gobwas/glob v0.2.3
38
38
github.com/gohugoio/go-i18n/v2 v2.1.3-0.20230805085216-e63c13218d0e
39
- github.com/gohugoio/hashstructure v0.1 .0
39
+ github.com/gohugoio/hashstructure v0.3 .0
40
40
github.com/gohugoio/httpcache v0.7.0
41
41
github.com/gohugoio/hugo-goldmark-extensions/extras v0.2.0
42
42
github.com/gohugoio/hugo-goldmark-extensions/passthrough v0.3.0
Original file line number Diff line number Diff line change @@ -227,6 +227,8 @@ github.com/gohugoio/go-i18n/v2 v2.1.3-0.20230805085216-e63c13218d0e h1:QArsSubW7
227
227
github.com/gohugoio/go-i18n/v2 v2.1.3-0.20230805085216-e63c13218d0e /go.mod h1:3Ltoo9Banwq0gOtcOwxuHG6omk+AwsQPADyw2vQYOJQ =
228
228
github.com/gohugoio/hashstructure v0.1.0 h1:kBSTMLMyTXbrJVAxaKI+wv30MMJJxn9Q8kfQtJaZ400 =
229
229
github.com/gohugoio/hashstructure v0.1.0 /go.mod h1:8ohPTAfQLTs2WdzB6k9etmQYclDUeNsIHGPAFejbsEA =
230
+ github.com/gohugoio/hashstructure v0.3.0 h1:orHavfqnBv0ffQmobOp41Y9HKEMcjrR/8EFAzpngmGs =
231
+ github.com/gohugoio/hashstructure v0.3.0 /go.mod h1:8ohPTAfQLTs2WdzB6k9etmQYclDUeNsIHGPAFejbsEA =
230
232
github.com/gohugoio/httpcache v0.7.0 h1:ukPnn04Rgvx48JIinZvZetBfHaWE7I01JR2Q2RrQ3Vs =
231
233
github.com/gohugoio/httpcache v0.7.0 /go.mod h1:fMlPrdY/vVJhAriLZnrF5QpN3BNAcoBClgAyQd+lGFI =
232
234
github.com/gohugoio/hugo-goldmark-extensions/extras v0.2.0 h1:MNdY6hYCTQEekY0oAfsxWZU1CDt6iH+tMLgyMJQh/sg =
You can’t perform that action at this time.
0 commit comments