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

Function BenchmarkMarshalJSON

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

Source from the content-addressed store, hash-verified

51}
52
53func 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
71func BenchmarkMarshalJSONNative(b *testing.B) {
72 record := newLogFFRecord()

Callers

nothing calls this directly

Calls 2

newLogRecordFunction · 0.85
FatalfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…