mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
Merge pull request #2964 from weaveworks/do-not-reportallocs
do not report allocations in benchmarks
This commit is contained in:
@@ -136,8 +136,9 @@ func BenchmarkLatestMapMerge(b *testing.B) {
|
||||
// two large maps with some overlap
|
||||
left := makeBenchmarkMap(0, 1000, time.Now())
|
||||
right := makeBenchmarkMap(700, 1700, time.Now().Add(1*time.Minute))
|
||||
b.ReportAllocs()
|
||||
|
||||
b.ResetTimer()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
left.Merge(right)
|
||||
}
|
||||
@@ -145,8 +146,9 @@ func BenchmarkLatestMapMerge(b *testing.B) {
|
||||
|
||||
func BenchmarkLatestMapEncode(b *testing.B) {
|
||||
map1 := makeBenchmarkMap(0, 1000, time.Now())
|
||||
b.ReportAllocs()
|
||||
|
||||
b.ResetTimer()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
buf := &bytes.Buffer{}
|
||||
codec.NewEncoder(buf, &codec.MsgpackHandle{}).Encode(&map1)
|
||||
@@ -157,8 +159,9 @@ func BenchmarkLatestMapDecode(b *testing.B) {
|
||||
map1 := makeBenchmarkMap(0, 1000, time.Now())
|
||||
buf := &bytes.Buffer{}
|
||||
codec.NewEncoder(buf, &codec.MsgpackHandle{}).Encode(&map1)
|
||||
b.ReportAllocs()
|
||||
|
||||
b.ResetTimer()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
var map1 StringLatestMap
|
||||
codec.NewDecoderBytes(buf.Bytes(), &codec.MsgpackHandle{}).Decode(&map1)
|
||||
|
||||
@@ -56,7 +56,7 @@ func BenchmarkMakeNodeSet(b *testing.B) {
|
||||
"b": "2",
|
||||
}))
|
||||
}
|
||||
b.ReportAllocs()
|
||||
|
||||
b.ResetTimer()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
@@ -161,7 +161,6 @@ func BenchmarkNodeSetAdd(b *testing.B) {
|
||||
"b": "2",
|
||||
})
|
||||
|
||||
b.ReportAllocs()
|
||||
b.ResetTimer()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
@@ -299,7 +298,7 @@ func BenchmarkNodeSetMerge(b *testing.B) {
|
||||
}),
|
||||
)
|
||||
}
|
||||
b.ReportAllocs()
|
||||
|
||||
b.ResetTimer()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
|
||||
Reference in New Issue
Block a user