MCPcopy
hub / github.com/pquerna/ffjson / BenchmarkMarshalJSONNativePool

Function BenchmarkMarshalJSONNativePool

tests/ff_test.go:89–106  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

87}
88
89func 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
108type NopWriter struct{}
109

Callers

nothing calls this directly

Calls 2

newLogFFRecordFunction · 0.85
FatalfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…