MCPcopy
hub / github.com/uber-go/zap / BenchmarkJSONLogMarshalerFunc

Function BenchmarkJSONLogMarshalerFunc

zapcore/json_encoder_bench_test.go:33–44  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

31)
32
33func BenchmarkJSONLogMarshalerFunc(b *testing.B) {
34 for i := 0; i < b.N; i++ {
35 enc := NewJSONEncoder(testEncoderConfig())
36 err := enc.AddObject("nested", ObjectMarshalerFunc(func(enc ObjectEncoder) error {
37 enc.AddInt64("i", int64(i))
38 return nil
39 }))
40 if err != nil {
41 b.Fatal(err)
42 }
43 }
44}
45
46func BenchmarkZapJSONFloat32AndComplex64(b *testing.B) {
47 b.RunParallel(func(pb *testing.PB) {

Callers

nothing calls this directly

Calls 6

NewJSONEncoderFunction · 0.85
testEncoderConfigFunction · 0.85
ObjectMarshalerFuncFuncType · 0.85
AddObjectMethod · 0.65
AddInt64Method · 0.65
FatalMethod · 0.45

Tested by

no test coverage detected