diff --git a/report/latest_map_internal_test.go b/report/latest_map_internal_test.go index e66ac8412..ddb3c043b 100644 --- a/report/latest_map_internal_test.go +++ b/report/latest_map_internal_test.go @@ -145,6 +145,28 @@ 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) + } +} + +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) + } +} + func TestLatestMapEncoding(t *testing.T) { now := time.Now() want := MakeStringLatestMap().