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 25.6.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 | 93.5 μs | 2.0× | 2.1× | 7.0× |
| 64 KB, pretty-printed | 98.8 μs | 1.9× | 2.0× | 6.7× |
| 256 KB | 372.0 μs | 1.9× | 2.1× | 7.0× |
| 256 KB, pretty-printed | 388.9 μs | 1.9× | 2.1× | 7.1× |
| 512 KB | 728.6 μs | 1.9× | 2.2× | 7.1× |
| 512 KB, pretty-printed | 765.4 μs | 1.9× | 2.1× | 7.1× |
| 1 MB | 1.46 ms | 1.9× | 2.2× | 6.9× |
| 1 MB, pretty-printed | 1.54 ms | 1.9× | 2.1× | 6.8× |
| 5 MB | 7.23 ms | 1.9× | 2.2× | 7.2× |
| 5 MB, pretty-printed | 7.69 ms | 1.9× | 2.1× | 6.9× |
| 1.15 ms | 1.9× | 2.0× | 8.2× | |
| Canada | 6.11 ms | 2.0× | 1.4× | 10.9× |
| Array | 116.8 μs | 2.7× | 0.8× | 25.6× |
| Deeply nested | 33.2 μs | 2.4× | 1.8× | 4.9× |
| Integers | 99.1 μs | 2.8× | 1.0× | 19.6× |
| Numeric | 79.0 μs | 5.3× | 0.9× | 16.1× |
| Strings | 11.3 μs | 7.7× | 9.9× | 9.4× |
Running the Benchmarks
The benchmarks are in the Benchmarks directory of the repository. To run them and regenerate these results, run ./instrument from that directory.