LEPTRIS

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 — competitorC / C++RubyPythonJavaScriptRust
libyaml1.34×+————
ryml1.18×+————

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.

operationleptris sidelibyaml 0.2.5standing
Parse DOM — block heavy162.38 MB/s61.11 MB/s2.66×
Parse pull — block heavy90.9 MB/s61.11 MB/s1.49×
Parse recorder — block heavy107.32 MB/s61.11 MB/s1.76×
Emit — block heavy320.74 MB/s61.11 MB/s5.25×
Parse DOM — scalar heavy446.54 MB/s94.96 MB/s4.70×
Parse pull — scalar heavy292.15 MB/s94.96 MB/s3.08×
Parse recorder — scalar heavy326.5 MB/s94.96 MB/s3.44×
Emit — scalar heavy513.97 MB/s94.96 MB/s5.41×
Parse DOM — anchor heavy117.6 MB/s59.32 MB/s1.98×
Parse pull — anchor heavy79.43 MB/s59.32 MB/s1.34×
Parse recorder — anchor heavy90.83 MB/s59.32 MB/s1.53×
Emit — anchor heavy364.78 MB/s59.32 MB/s6.15×
Parse DOM — deep nesting501.6 MB/s155.56 MB/s3.22×
Parse pull — deep nesting249.2 MB/s155.56 MB/s1.60×
Parse recorder — deep nesting330.64 MB/s155.56 MB/s2.13×
Emit — deep nesting466.52 MB/s155.56 MB/s3.00×
Parse DOM — wide mapping248.67 MB/s70.48 MB/s3.53×
Parse pull — wide mapping133.45 MB/s70.48 MB/s1.89×
Parse recorder — wide mapping163.67 MB/s70.48 MB/s2.32×
Emit — wide mapping387.26 MB/s70.48 MB/s5.49×
Parse DOM — realworld suite70.42 MB/s44.05 MB/s1.60×
Parse pull — realworld suite61.18 MB/s44.05 MB/s1.39×
Parse recorder — realworld suite73.59 MB/s44.05 MB/s1.67×
Emit — realworld suite251.81 MB/s44.05 MB/s5.72×

fresh runyeptris 0.6.22 (main f4b6e55)·min-of-iters; h2h rows: interleaved, median of rounds·GitHub Actions ubuntu-latest, x86_64 (AVX2)··bench_matrix — same corpus both engines, same run; h2h rows: interleaved head-to-head, median of rounds; simdjson parses a pre-built padded string (calibrated, #420)

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. The numbers on this page come from the Linux CI runner, where the AVX2 kernels dispatch: all five YAML shapes are ahead — block-heavy 1.61×, wide-mapping 1.80×, anchor-heavy 1.44× (the shape the ledger once named the open target), scalar-heavy 1.23×, deep-nesting 1.18×. The ARM macOS leg is the mixed read, and it is tracked with the same discipline. Every optimization attempt on these rows is recorded in the ledger with before-and-after numbers, including the attempts that measured flat and were reverted.

operationleptris sideryml 0.16.0standing
Head-to-head DOM — block heavy158.16 MB/sryml 0.16.0 (f8ac8dd)1.61×
Head-to-head DOM — scalar heavy441.62 MB/sryml 0.16.0 (f8ac8dd)1.23×
Head-to-head DOM — anchor heavy133.68 MB/sryml 0.16.0 (f8ac8dd)1.44×
Head-to-head DOM — deep nesting508.81 MB/sryml 0.16.0 (f8ac8dd)1.18×
Head-to-head DOM — wide mapping245.05 MB/sryml 0.16.0 (f8ac8dd)1.80×

The recorded residual is leg-specific: the NEON macOS runner reads closer to parity on several shapes than the AVX2 leg above, and that difference is tracked rather than smoothed over — the campaign logs treat an unexplained ISA gap as a defect. 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. The current campaign carries none — the first refresh in the page's history where that is true — and the ARM-leg parity reads closest to the line stay tracked in the ledger rather than celebrated here.