aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/map_benchmark_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/map_benchmark_test.go')
-rw-r--r--src/runtime/map_benchmark_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/runtime/map_benchmark_test.go b/src/runtime/map_benchmark_test.go
index 663abf6202..6f527c3af6 100644
--- a/src/runtime/map_benchmark_test.go
+++ b/src/runtime/map_benchmark_test.go
@@ -1008,11 +1008,12 @@ func benchmarkMapDelete[K mapBenchmarkKeyType, E mapBenchmarkElemType](b *testin
for i := 0; i < b.N; i++ {
if len(m) == 0 {
- b.StopTimer()
+ // We'd like to StopTimer while refilling the map, but
+ // it is way too expensive and thus makes the benchmark
+ // take a long time. See https://go.dev/issue/20875.
for j := range k {
m[k[j]] = e[j]
}
- b.StartTimer()
}
delete(m, k[i%n])
}