(b *testing.B)
| 87 | } |
| 88 | |
| 89 | func BenchmarkMarshalJSONNativePool(b *testing.B) { |
| 90 | record := newLogFFRecord() |
| 91 | |
| 92 | buf, err := json.Marshal(&record) |
| 93 | if err != nil { |
| 94 | b.Fatalf("Marshal: %v", err) |
| 95 | } |
| 96 | b.SetBytes(int64(len(buf))) |
| 97 | |
| 98 | b.ResetTimer() |
| 99 | for i := 0; i < b.N; i++ { |
| 100 | bytes, err := ffjson.MarshalFast(record) |
| 101 | if err != nil { |
| 102 | b.Fatalf("Marshal: %v", err) |
| 103 | } |
| 104 | ffjson.Pool(bytes) |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | type NopWriter struct{} |
| 109 |
nothing calls this directly
no test coverage detected
searching dependent graphs…