Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Latest commit

 

History

History
16 lines (12 loc) · 589 Bytes

README.md

File metadata and controls

16 lines (12 loc) · 589 Bytes

Json valid benchmark

This repository contains simple code for validating JSON strings to showcase the speed difference between json.Valid and json.Unmarshal(...) == nil

Run benchmarks

make bench

Results

Hardware: cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz

Benchmark name Iterations Time per operation Bits allocated per operation Allocations per operation
BenchmarkJsonValid-12 2416996 486.0 ns/op 144 B/op 1 allocs/op
BenchmarkJsonUnmarshalValid-12 645478 1844 ns/op 1152 B/op 19 allocs/op