aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/exp/html/token_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/exp/html/token_test.go')
-rw-r--r--src/pkg/exp/html/token_test.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/pkg/exp/html/token_test.go b/src/pkg/exp/html/token_test.go
index 63a8bfc483..14e23467f4 100644
--- a/src/pkg/exp/html/token_test.go
+++ b/src/pkg/exp/html/token_test.go
@@ -634,9 +634,7 @@ func benchmarkTokenizer(b *testing.B, level int) {
}
b.SetBytes(int64(len(buf)))
runtime.GC()
- var ms runtime.MemStats
- runtime.ReadMemStats(&ms)
- mallocs := ms.Mallocs
+ b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
z := NewTokenizer(bytes.NewBuffer(buf))
@@ -674,10 +672,6 @@ func benchmarkTokenizer(b *testing.B, level int) {
}
}
}
- b.StopTimer()
- runtime.ReadMemStats(&ms)
- mallocs = ms.Mallocs - mallocs
- b.Logf("%d iterations, %d mallocs per iteration\n", b.N, int(mallocs)/b.N)
}
func BenchmarkRawLevelTokenizer(b *testing.B) { benchmarkTokenizer(b, rawLevel) }