diff --git a/benchmarks/encode_test.go b/benchmarks/encode_test.go index 7031b58..47c76db 100644 --- a/benchmarks/encode_test.go +++ b/benchmarks/encode_test.go @@ -558,6 +558,52 @@ func Benchmark_Encode_Interface_GoJson(b *testing.B) { } } +func Benchmark_Encode_Bool_EncodingJson(b *testing.B) { + b.ReportAllocs() + for i := 0; i < b.N; i++ { + if _, err := json.Marshal(true); err != nil { + b.Fatal(err) + } + } +} + +func Benchmark_Encode_Bool_JsonIter(b *testing.B) { + var json = jsoniter.ConfigCompatibleWithStandardLibrary + b.ReportAllocs() + for i := 0; i < b.N; i++ { + if _, err := json.Marshal(true); err != nil { + b.Fatal(err) + } + } +} + +func Benchmark_Encode_Bool_Jettison(b *testing.B) { + b.ReportAllocs() + for i := 0; i < b.N; i++ { + if _, err := jettison.Marshal(true); err != nil { + b.Fatal(err) + } + } +} + +func Benchmark_Encode_Bool_SegmentioJson(b *testing.B) { + b.ReportAllocs() + for i := 0; i < b.N; i++ { + if _, err := segmentiojson.Marshal(true); err != nil { + b.Fatal(err) + } + } +} + +func Benchmark_Encode_Bool_GoJson(b *testing.B) { + b.ReportAllocs() + for i := 0; i < b.N; i++ { + if _, err := gojson.Marshal(true); err != nil { + b.Fatal(err) + } + } +} + func Benchmark_Encode_Int_EncodingJson(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ {