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

Function BenchmarkBoolsArrayMarshaler

array_test.go:35–44  ·  array_test.go::BenchmarkBoolsArrayMarshaler
(b *testing.B)

Source from the content-addressed store, hash-verified

33)
34
35func BenchmarkBoolsArrayMarshaler(b *testing.B) {
36 // Keep this benchmark here to capture the overhead of the ArrayMarshaler
37 // wrapper.
38 bs := make([]bool, 50)
39 enc := zapcore.NewJSONEncoder(zapcore.EncoderConfig{})
40 b.ResetTimer()
41 for i := 0; i < b.N; i++ {
42 Bools("array", bs).AddTo(enc.Clone())
43 }
44}
45
46func BenchmarkBoolsReflect(b *testing.B) {
47 bs := make([]bool, 50)

Callers

nothing calls this directly

Calls 4

NewJSONEncoderFunction · 0.92
BoolsFunction · 0.85
AddToMethod · 0.80
CloneMethod · 0.65

Tested by

no test coverage detected