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:

InputJason (ips)Eyeon text (ips)Ratio
blockchain.json (17 KB)18,3702,1508.5x
github.json (54 KB)5,3201,4403.7x
pokedex.json (55 KB)3,1504307.3x
canada.json (2,198 KB)532.323x

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:

InputEyeon binary (ips)Jason (ips)Ratio
blockchain.json (17 KB)18,06018,3701.02x
github.json (54 KB)5,4505,3200.98x
pokedex.json (55 KB)2,5403,1501.24x
canada.json (2,198 KB)44531.20x

Memory Usage (Decode)

InputJasonEyeon textEyeon binary
blockchain.json0.05 MB0.94 MB0.20 MB
github.json0.12 MB2.52 MB0.54 MB
pokedex.json0.38 MB5.52 MB1.42 MB
canada.json11.04 MB379.50 MB43.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):

InputJason (ips)Eyeon binary (ips)Eyeon text (ips)Binary ratioText ratio
blockchain.json (17 KB)20,5306,6902,3503.1x8.7x
github.json (54 KB)6,0002,3505902.6x10.1x
pokedex.json (55 KB)2,5618643813.0x6.7x
canada.json (2,198 KB)11569211.7x5.4x

Memory Usage (Encode)

InputJasonEyeon binaryEyeon text
blockchain.json79 KB177 KB585 KB
github.json221 KB432 KB2,153 KB
pokedex.json0.64 MB1.09 MB2.07 MB
canada.json9.22 MB16.29 MB18.56 MB