(b *testing.B)
| 51 | } |
| 52 | |
| 53 | func BenchmarkMarshalJSON(b *testing.B) { |
| 54 | record := newLogRecord() |
| 55 | |
| 56 | buf, err := json.Marshal(&record) |
| 57 | if err != nil { |
| 58 | b.Fatalf("Marshal: %v", err) |
| 59 | } |
| 60 | b.SetBytes(int64(len(buf))) |
| 61 | |
| 62 | b.ResetTimer() |
| 63 | for i := 0; i < b.N; i++ { |
| 64 | _, err := json.Marshal(&record) |
| 65 | if err != nil { |
| 66 | b.Fatalf("Marshal: %v", err) |
| 67 | } |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | func BenchmarkMarshalJSONNative(b *testing.B) { |
| 72 | record := newLogFFRecord() |
nothing calls this directly
no test coverage detected
searching dependent graphs…