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

Function BenchmarkSimpleUnmarshal

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

Source from the content-addressed store, hash-verified

131}
132
133func BenchmarkSimpleUnmarshal(b *testing.B) {
134 record := newLogFFRecord()
135 buf := []byte(`{"id": 123213, "OriginID": 22, "meth": "GET"}`)
136 err := record.UnmarshalJSON(buf)
137 if err != nil {
138 b.Fatalf("UnmarshalJSON: %v", err)
139 }
140 b.SetBytes(int64(len(buf)))
141
142 b.ResetTimer()
143 for i := 0; i < b.N; i++ {
144 err := record.UnmarshalJSON(buf)
145 if err != nil {
146 b.Fatalf("UnmarshalJSON: %v", err)
147 }
148 }
149}
150
151func BenchmarkSXimpleUnmarshalNative(b *testing.B) {
152 record := newLogRecord()

Callers

nothing calls this directly

Calls 3

newLogFFRecordFunction · 0.85
FatalfMethod · 0.65
UnmarshalJSONMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…