Index: src/pkg/exp/html/token_test.go |
=================================================================== |
--- a/src/pkg/exp/html/token_test.go |
+++ b/src/pkg/exp/html/token_test.go |
@@ -634,9 +634,7 @@ |
} |
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 @@ |
} |
} |
} |
- 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) } |