(b *testing.B)
| 112 | } |
| 113 | |
| 114 | func BenchmarkMarshalJSONNativeReuse(b *testing.B) { |
| 115 | record := newLogFFRecord() |
| 116 | |
| 117 | buf, err := json.Marshal(&record) |
| 118 | if err != nil { |
| 119 | b.Fatalf("Marshal: %v", err) |
| 120 | } |
| 121 | b.SetBytes(int64(len(buf))) |
| 122 | |
| 123 | enc := ffjson.NewEncoder(&NopWriter{}) |
| 124 | b.ResetTimer() |
| 125 | for i := 0; i < b.N; i++ { |
| 126 | err := enc.Encode(record) |
| 127 | if err != nil { |
| 128 | b.Fatalf("Marshal: %v", err) |
| 129 | } |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | func BenchmarkSimpleUnmarshal(b *testing.B) { |
| 134 | record := newLogFFRecord() |
nothing calls this directly
no test coverage detected
searching dependent graphs…