Skip to content

Commit

Permalink
benchmark cost of encoding float32, complex64
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinav committed Sep 10, 2021
1 parent 7255fee commit e272362
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions zapcore/json_encoder_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ func BenchmarkJSONLogMarshalerFunc(b *testing.B) {
}
}

func BenchmarkZapJSONFloat32AndComplex64(b *testing.B) {
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
enc := NewJSONEncoder(testEncoderConfig())
enc.AddFloat32("float32", 3.14)
enc.AddComplex64("complex64", 2.71+3.14i)
}
})
}

func BenchmarkZapJSON(b *testing.B) {
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
Expand Down

0 comments on commit e272362

Please sign in to comment.