Eyeon is benchmarked against Jason, which is actually pretty fast. Since all JSON is valid Ion, we can do a direct apples-to-apples comparison using the same payloads.
Benchmark data files are sourced from Jason's own benchmark suite. Ion binary benchmarks use those same payloads pre-encoded to Ion binary format.
Running Benchmarks
# Decode benchmarks (Jason vs Eyeon text vs Eyeon binary)
mix run bench/decode.exs
# Encode benchmarks (Jason vs Eyeon text vs Eyeon binary)
mix run bench/encode.exs
Results are written to bench/output/ as markdown files.
Environment
- OS: macOS (Apple M4 Pro)
- Cores: 12
- RAM: 24 GB
- Elixir: 1.19.5
- Erlang/OTP: 28.3.1 (JIT enabled)
Decode
Jason vs Eyeon text decode, using the same JSON input for both:
| Input | Jason (ips) | Eyeon text (ips) | Ratio |
|---|---|---|---|
| blockchain.json (17 KB) | 18,370 | 2,150 | 8.5x |
| github.json (54 KB) | 5,320 | 1,440 | 3.7x |
| pokedex.json (55 KB) | 3,150 | 430 | 7.3x |
| canada.json (2,198 KB) | 53 | 2.3 | 23x |
The previous leex/yecc three-pass pipeline was 60-100x slower than Jason. The single-pass recursive descent parser brought this down to 4-23x, a 7-10x improvement over the old pipeline.
Ion Binary Decode
Decoding from Ion binary format is dramatically faster than text and competitive with Jason:
| Input | Eyeon binary (ips) | Jason (ips) | Ratio |
|---|---|---|---|
| blockchain.json (17 KB) | 18,060 | 18,370 | 1.02x |
| github.json (54 KB) | 5,450 | 5,320 | 0.98x |
| pokedex.json (55 KB) | 2,540 | 3,150 | 1.24x |
| canada.json (2,198 KB) | 44 | 53 | 1.20x |
Memory Usage (Decode)
| Input | Jason | Eyeon text | Eyeon binary |
|---|---|---|---|
| blockchain.json | 0.05 MB | 0.94 MB | 0.20 MB |
| github.json | 0.12 MB | 2.52 MB | 0.54 MB |
| pokedex.json | 0.38 MB | 5.52 MB | 1.42 MB |
| canada.json | 11.04 MB | 379.50 MB | 43.05 MB |
Memory for text decode also improved significantly — canada.json went from 2,764 MB to 380 MB (7.3x less allocation).
Encode
All three encoders given the same Elixir values (decoded from JSON via Jason):
| Input | Jason (ips) | Eyeon binary (ips) | Eyeon text (ips) | Binary ratio | Text ratio |
|---|---|---|---|---|---|
| blockchain.json (17 KB) | 20,530 | 6,690 | 2,350 | 3.1x | 8.7x |
| github.json (54 KB) | 6,000 | 2,350 | 590 | 2.6x | 10.1x |
| pokedex.json (55 KB) | 2,561 | 864 | 381 | 3.0x | 6.7x |
| canada.json (2,198 KB) | 115 | 69 | 21 | 1.7x | 5.4x |
Memory Usage (Encode)
| Input | Jason | Eyeon binary | Eyeon text |
|---|---|---|---|
| blockchain.json | 79 KB | 177 KB | 585 KB |
| github.json | 221 KB | 432 KB | 2,153 KB |
| pokedex.json | 0.64 MB | 1.09 MB | 2.07 MB |
| canada.json | 9.22 MB | 16.29 MB | 18.56 MB |