diff --git a/benchmarks/decode_test.go b/benchmarks/decode_test.go index aeb33db..011fed3 100644 --- a/benchmarks/decode_test.go +++ b/benchmarks/decode_test.go @@ -31,6 +31,16 @@ func Benchmark_Decode_SmallStruct_Unmarshal_JsonIter(b *testing.B) { } } +func Benchmark_Decode_SmallStruct_Unmarshal_EasyJson(b *testing.B) { + b.ReportAllocs() + for i := 0; i < b.N; i++ { + result := NewSmallPayloadEasyJson() + if err := result.UnmarshalJSON(SmallFixture); err != nil { + b.Fatal(err) + } + } +} + func Benchmark_Decode_SmallStruct_Unmarshal_GoJay(b *testing.B) { b.ReportAllocs() for n := 0; n < b.N; n++ { @@ -161,6 +171,16 @@ func Benchmark_Decode_MediumStruct_Unmarshal_JsonIter(b *testing.B) { } } +func Benchmark_Decode_MediumStruct_Unmarshal_EasyJson(b *testing.B) { + b.ReportAllocs() + for i := 0; i < b.N; i++ { + result := NewMediumPayloadEasyJson() + if err := result.UnmarshalJSON(MediumFixture); err != nil { + b.Fatal(err) + } + } +} + func Benchmark_Decode_MediumStruct_Unmarshal_GoJay(b *testing.B) { b.ReportAllocs() for n := 0; n < b.N; n++ { @@ -291,6 +311,16 @@ func Benchmark_Decode_LargeStruct_Unmarshal_JsonIter(b *testing.B) { } } +func Benchmark_Decode_LargeStruct_Unmarshal_EasyJson(b *testing.B) { + b.ReportAllocs() + for i := 0; i < b.N; i++ { + result := NewLargePayloadEasyJson() + if err := result.UnmarshalJSON(LargeFixture); err != nil { + b.Fatal(err) + } + } +} + func Benchmark_Decode_LargeStruct_Unmarshal_GoJay(b *testing.B) { b.ReportAllocs() for n := 0; n < b.N; n++ {