aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/mapspeed_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/runtime/mapspeed_test.go')
-rw-r--r--src/pkg/runtime/mapspeed_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pkg/runtime/mapspeed_test.go b/src/pkg/runtime/mapspeed_test.go
index 4d77347b24..73be434535 100644
--- a/src/pkg/runtime/mapspeed_test.go
+++ b/src/pkg/runtime/mapspeed_test.go
@@ -118,6 +118,17 @@ func BenchmarkMegOneMap(b *testing.B) {
}
}
+func BenchmarkMegEqMap(b *testing.B) {
+ m := make(map[string]bool)
+ key1 := strings.Repeat("X", 1<<20)
+ key2 := strings.Repeat("X", 1<<20) // equal but different instance
+ m[key1] = true
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, _ = m[key2]
+ }
+}
+
func BenchmarkMegEmptyMap(b *testing.B) {
m := make(map[string]bool)
key := strings.Repeat("X", 1<<20)