MCPcopy Index your code
hub / github.com/pquerna/ffjson / BenchmarkMarshalJSONNative

Function BenchmarkMarshalJSONNative

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

Source from the content-addressed store, hash-verified

69}
70
71func BenchmarkMarshalJSONNative(b *testing.B) {
72 record := newLogFFRecord()
73
74 buf, err := json.Marshal(record)
75 if err != nil {
76 b.Fatalf("Marshal: %v", err)
77 }
78 b.SetBytes(int64(len(buf)))
79
80 b.ResetTimer()
81 for i := 0; i < b.N; i++ {
82 _, err := ffjson.MarshalFast(record)
83 if err != nil {
84 b.Fatalf("Marshal: %v", err)
85 }
86 }
87}
88
89func BenchmarkMarshalJSONNativePool(b *testing.B) {
90 record := newLogFFRecord()

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…