Benchmarks · YAML
yeptris, the YAML engine
yeptris is the YAML counterpart of libleptris: a YAML 1.2 parser, emitter and streamer in C11 with hard memory bounds. The benchmark matrix runs both engines over the same corpora in the same process, across eight document shapes and three consumption models — DOM construction, pull parsing and event recording — in addition to emission. Every corpus is generated deterministically with a fixed seed, and the harness can dump each corpus so that any number on this page reproduces byte for byte.
| YAML — competitor | C / C++ | Ruby | Python |
|---|---|---|---|
| libyaml | 1.76×+ | — | — |
| ryml | 0.62×–1.05× | — | — |
A green cell with a single value means every measured operation in that race is ahead, and the value shown is the smallest margin. A neutral cell shows the range from the weakest to the strongest operation; hovering lists the operations that remain behind. All rows, including deficits, appear in the tables below.
C
Versus libyaml
libyaml is the reference implementation underlying Ruby’s Psych and a large share of YAML tooling. The comparison below is the committed release gate: every shape and consumption model must stay ahead of the same-run libyaml measurement, and the weakest cell is the headline of each release.
| operation | leptris side | libyaml 0.2.5 | standing |
|---|---|---|---|
| Parse DOM — block heavy | 144.51 MB/s | 50.96 MB/s | 2.84× |
| Parse pull — block heavy | 124.57 MB/s | 50.96 MB/s | 2.44× |
| Parse recorder — block heavy | 139.48 MB/s | 50.96 MB/s | 2.74× |
| Emit — block heavy | 141.52 MB/s | 50.96 MB/s | 2.78× |
| Parse DOM — scalar heavy | 336.23 MB/s | 79.43 MB/s | 4.23× |
| Parse pull — scalar heavy | 269.53 MB/s | 79.43 MB/s | 3.39× |
| Parse recorder — scalar heavy | 306.36 MB/s | 79.43 MB/s | 3.86× |
| Emit — scalar heavy | 220.54 MB/s | 79.43 MB/s | 2.78× |
| Parse DOM — anchor heavy | 109.28 MB/s | 53.49 MB/s | 2.04× |
| Parse pull — anchor heavy | 94.24 MB/s | 53.49 MB/s | 1.76× |
| Parse recorder — anchor heavy | 102.75 MB/s | 53.49 MB/s | 1.92× |
| Emit — anchor heavy | 165.62 MB/s | 53.49 MB/s | 3.10× |
| Parse DOM — deep nesting | 479.98 MB/s | 152.02 MB/s | 3.16× |
| Parse pull — deep nesting | 381.43 MB/s | 152.02 MB/s | 2.51× |
| Parse recorder — deep nesting | 443.92 MB/s | 152.02 MB/s | 2.92× |
| Emit — deep nesting | 637.1 MB/s | 152.02 MB/s | 4.19× |
| Parse DOM — wide mapping | 191.46 MB/s | 58.56 MB/s | 3.27× |
| Parse pull — wide mapping | 157.46 MB/s | 58.56 MB/s | 2.69× |
| Parse recorder — wide mapping | 177.15 MB/s | 58.56 MB/s | 3.02× |
| Emit — wide mapping | 160.29 MB/s | 58.56 MB/s | 2.74× |
| Parse DOM — realworld suite | 88.42 MB/s | 42.43 MB/s | 2.08× |
| Parse pull — realworld suite | 77.5 MB/s | 42.43 MB/s | 1.83× |
| Parse recorder — realworld suite | 89.32 MB/s | 42.43 MB/s | 2.11× |
| Emit — realworld suite | 140.17 MB/s | 42.43 MB/s | 3.30× |
fresh runyeptris 0.2.4 (main 9674b80)·min-of-iters (--full); ryml rows: interleaved, median of rounds·Apple M1 Max, macOS 14.1.1, arm64··bench_matrix --full — same corpus both engines, same run; vs ryml: interleaved head-to-head
Versus rapidyaml
rapidyaml is a C++ YAML parser with a substantially different internal design, and the comparison against it is run as an interleaved head-to-head with a fair ordering referee, reporting the median of rounds. On this machine, whose ARM cores run the NEON kernels, the standing is mixed; the performance ledger records that on the Linux CI runners, where the AVX2 kernels now dispatch correctly, six of the eight shapes are ahead, block parsing sits at parity, and anchor-heavy remains the open target. Every optimization attempt against this gap is recorded in the ledger with before-and-after numbers, including the attempts that measured flat and were reverted.
| operation | leptris side | ryml 0.16.0 | standing |
|---|---|---|---|
| Head-to-head DOM — block heavy | — | ryml 0.16.0 (f8ac8dd) | 0.73× |
| Head-to-head DOM — scalar heavy | — | ryml 0.16.0 (f8ac8dd) | 0.84× |
| Head-to-head DOM — anchor heavy | — | ryml 0.16.0 (f8ac8dd) | 0.62× |
| Head-to-head DOM — deep nesting | — | ryml 0.16.0 (f8ac8dd) | 1.05× |
| Head-to-head DOM — wide mapping | — | ryml 0.16.0 (f8ac8dd) | 1.01× |
The recorded residual against rapidyaml concentrates in anchor-and-alias machinery and block-structure construction, where rapidyaml builds leaner nodes with a lazier strategy. The discipline file for this work is theyeptris performance ledger. The JSON-shaped corpora in the same matrix are presented on theJSON page.
To reproduce: configure yeptris with-DYEPTRIS_BUILD_BENCHMARKS=ON -DYEPTRIS_BENCH_LIBYAML_ROOT=…(and -DYEPTRIS_BENCH_RYML_ROOT=… for the head-to-head), then run bench_matrix --full. The harness is committed atbenchmarks.
YAML
Measured deficits
Every YAML operation in the result data that remains behind its competitor, ordered from the weakest ratio. All of the current deficits are in the interleaved head-to-head against rapidyaml.
| operation | leptris side | versus | standing |
|---|---|---|---|
| Head-to-head DOM — anchor heavy | — | ryml 0.16.0 (f8ac8dd) | 0.62× |
| Head-to-head DOM — block heavy | — | ryml 0.16.0 (f8ac8dd) | 0.73× |
| Head-to-head DOM — scalar heavy | — | ryml 0.16.0 (f8ac8dd) | 0.84× |