CToon Benchmarks

ctoon, measured honestly

Every ctoon language binding — C, C++, Python, Go, Rust, Zig, MATLAB — benchmarked head-to-head against every maintained competing TOON implementation that exists for that language.

generated 2026-09-30 12:45 UTC
Method

Key order sample

Every "Key order preservation" table below round-trips this exact JSON through that library and checks whether the keys come back in this same order — deliberately non-alphabetical, with a nested object and an array of objects, so sorting or hash-based reordering would show up.

{"zebra": 1, "apple": 2, "mango": 3, "nested": {"beta": true, "alpha": false}, "list": [{"z": 1, "a": 2}, {"z": 3, "a": 4}]}
C

C bindings

Corpus: 457 files, 2.8 MB.

Average across the whole corpus

JSON → TOON

Throughput vs. input size — one line per library, marker per size bucket.

TOON → JSON

Throughput vs. input size — one line per library, marker per size bucket.

Roundtrip (self-consistency)

Throughput vs. input size — one line per library, marker per size bucket.

Peak memory (isolated per library)

Operation Library MB/s docs/s Success rate Total time (s) Peak RSS (MB)
JSON → TOON ctoon 322.57 49887.0 100.0% 0.183 7.51
TOON → JSON ctoon 196.22 50001.6 100.0% 0.183 7.51
TOON → JSON TOONc 77.52 20258.5 98.5% 0.444 7.48
Roundtrip (self-consistency) ctoon 153.01 23664.0 100.0% 0.386 7.51

Key order preservation

Round-trips the fixed sample below through each library and checks whether keys come back in the same order they went in.

LibraryOrder preservedDetail
ctoon ✓ yes —
TOONc ✓ yes —
C++

C++ bindings

Corpus: 457 files, 2.8 MB.

Average across the whole corpus

JSON → TOON

Throughput vs. input size — one line per library, marker per size bucket.

TOON → JSON

Throughput vs. input size — one line per library, marker per size bucket.

Roundtrip (self-consistency)

Throughput vs. input size — one line per library, marker per size bucket.

Peak memory (isolated per library)

Operation Library MB/s docs/s Success rate Total time (s) Peak RSS (MB)
JSON → TOON ctoon 330.34 51087.4 100.0% 0.179 9.21
TOON → JSON ctoon 194.84 49648.0 100.0% 0.184 9.21
Roundtrip (self-consistency) ctoon 155.19 24000.0 100.0% 0.381 9.21

Key order preservation

Round-trips the fixed sample below through each library and checks whether keys come back in the same order they went in.

LibraryOrder preservedDetail
ctoon ✓ yes —
Go

Go bindings

Corpus: 457 files, 2.8 MB.

Average across the whole corpus

Operation Library MB/s docs/s Success rate Total time (s)
JSON → TOON ctoon 91.75 14188.8 100% 0.644
JSON → TOON gotoon 30.69 4746.3 100% 1.926
JSON → TOON toon-go 41.93 6928.0 89.3% 1.178
TOON → JSON ctoon 56.61 14426.1 100% 0.634
TOON → JSON toon-go 0.82 473.2 0.7% 0.127
Roundtrip (self-consistency) ctoon 46.99 7267.3 100% 1.258
Roundtrip (self-consistency) toon-go 0.29 33.8 0.4% 1.183
Julia

Julia bindings

Corpus: 457 files, 2.8 MB.

Average across the whole corpus

Operation Library MB/s docs/s Success rate Total time (s)
JSON → TOON ctoon 56.24 8696.9 100.0% 1.051
TOON → JSON ctoon 39.73 10124.2 100.0% 0.903
Roundtrip (self-consistency) ctoon 33.06 5112.2 100.0% 1.788
MATLAB

MATLAB bindings

Corpus: 457 files, 2.8 MB.

Average across the whole corpus

Operation Library MB/s docs/s Success rate Total time (s)
JSON → TOON ctoon 13.72 2123.8 100% 4.304
TOON → JSON ctoon 41.37 10950.2 100% 0.835
Roundtrip (self-consistency) ctoon 10.98 1699.5 100% 5.378
Node.js

Node.js bindings

Corpus: 457 files, 2.8 MB.

Average across the whole corpus

Operation Library MB/s docs/s Success rate Total time (s)
JSON → TOON @toon-format/toon 48.24 7460.7 100% 1.225
TOON → JSON @toon-format/toon 14.44 3680.3 100% 2.483
Roundtrip (self-consistency) @toon-format/toon 16.18 2502.1 100% 3.653
Python

Python bindings

Corpus: 457 files, 2.8 MB.

Average across the whole corpus

JSON → TOON

Throughput vs. input size — one line per library, marker per size bucket.

TOON → JSON

Throughput vs. input size — one line per library, marker per size bucket.

Roundtrip (self-consistency)

Throughput vs. input size — one line per library, marker per size bucket.

Peak memory (isolated per library)

Operation Library MB/s docs/s Success rate Total time (s) Peak RSS (MB)
JSON → TOON ctoon 118.97 18399.7 100.0% 0.497 30.87
JSON → TOON toon_format 18.0 2783.3 100.0% 3.284 30.21
JSON → TOON toons 126.99 19639.3 100.0% 0.465 31.05
TOON → JSON ctoon 70.41 17940.7 100.0% 0.509 30.87
TOON → JSON toon_format 3.67 1215.5 77.0% 5.792 30.21
TOON → JSON toons 25.06 6528.1 96.1% 1.345 31.05
Roundtrip (self-consistency) ctoon 57.92 8958.0 100.0% 1.02 30.87
Roundtrip (self-consistency) toon_format 4.49 790.0 88.8% 10.279 30.21
Roundtrip (self-consistency) toons 29.48 4559.3 100.0% 2.005 31.05

Key order preservation

Round-trips the fixed sample below through each library and checks whether keys come back in the same order they went in.

LibraryOrder preservedDetail
ctoon ✓ yes —
toon_format ✓ yes —
toons ✓ yes —
Rust

Rust bindings

Corpus: 457 files, 2.8 MB.

Average across the whole corpus

Operation Library MB/s docs/s Success rate Total time (s)
JSON → TOON ctoon 144.32 22319.0 100.0% 0.41
JSON → TOON toon-rust 59.16 9149.7 100.0% 0.999
TOON → JSON ctoon 85.21 21714.0 100.0% 0.421
TOON → JSON toon-rust 19.15 11942.0 36.5% 0.28
Roundtrip (self-consistency) ctoon 69.83 10800.0 100.0% 0.846
Roundtrip (self-consistency) toon-rust 30.9 4851.8 96.3% 1.814
Zig

Zig bindings

Corpus: 457 files, 2.8 MB.

Average across the whole corpus

Operation Library MB/s docs/s Success rate Total time (s)
JSON → TOON ctoon 166.86 25805.0 100.0% 0.354
TOON → JSON ctoon 102.54 26129.5 100.0% 0.35
Roundtrip (self-consistency) ctoon 83.81 12961.6 100.0% 0.705
Environment

What machine these numbers ran on

Recorded automatically by system_info.py at run time — not filled in by hand. Numbers above are only meaningful relative to each other on this specific machine; they won't transfer directly to yours.

CPU13th Gen Intel(R) Core(TM) i7-13620H
Logical cores16
RAM30.5 GiB
Architecturex86_64
OSLinux 7.0.0-30-generic
PythonCPython 3.12.14