Benchmarks

JBird is benchmarked against Foundation, Freddy, and SwiftyJSON with package-benchmark. The inputs include documents from 64 KB to 5 MB in minified and pretty-printed formats, real-world documents, and documents made up mostly of one kind of value.

The results were recorded on an arm64 Mac with 16 cores and 128 GB of memory, running Darwin 27.0.0.

Summary

JBird’s median time to parse each input, and how many times faster JBird is than each library. Select an input to see every metric for every library.

Input JBird vs Foundation vs Freddy vs SwiftyJSON
64 KB 94.0 μs 1.9× 2.1× 7.1×
64 KB, pretty-printed 96.7 μs 1.9× 2.1× 7.0×
256 KB 367.1 μs 1.9× 2.2× 7.2×
256 KB, pretty-printed 381.4 μs 1.9× 2.1× 7.1×
512 KB 723.5 μs 1.9× 2.2× 7.3×
512 KB, pretty-printed 757.8 μs 1.9× 2.2× 7.2×
1 MB 1.47 ms 1.9× 2.2× 7.4×
1 MB, pretty-printed 1.52 ms 1.9× 2.1× 6.8×
5 MB 7.27 ms 1.9× 2.2× 7.6×
5 MB, pretty-printed 7.57 ms 1.9× 2.1× 7.1×
Twitter 1.14 ms 1.9× 2.0× 8.5×
Canada 5.98 ms 2.2× 1.5× 11.2×
Array 114.3 μs 2.8× 0.9× 28.1×
Deeply nested 32.8 μs 2.4× 1.8× 4.9×
Integers 97.3 μs 2.8× 1.0× 20.0×
Numeric 65.9 μs 6.2× 1.1× 20.8×
Strings 10.3 μs 7.8× 10.7× 10.4×

Running the Benchmarks

The benchmarks are in the Benchmarks directory of the repository. To run them and regenerate these results, run mise run benchmark:record from the root of the repository.