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++RubyPython
libyaml1.76×+
ryml0.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.

operationleptris sidelibyaml 0.2.5standing
Parse DOM — block heavy144.51 MB/s50.96 MB/s2.84×
Parse pull — block heavy124.57 MB/s50.96 MB/s2.44×
Parse recorder — block heavy139.48 MB/s50.96 MB/s2.74×
Emit — block heavy141.52 MB/s50.96 MB/s2.78×
Parse DOM — scalar heavy336.23 MB/s79.43 MB/s4.23×
Parse pull — scalar heavy269.53 MB/s79.43 MB/s3.39×
Parse recorder — scalar heavy306.36 MB/s79.43 MB/s3.86×
Emit — scalar heavy220.54 MB/s79.43 MB/s2.78×
Parse DOM — anchor heavy109.28 MB/s53.49 MB/s2.04×
Parse pull — anchor heavy94.24 MB/s53.49 MB/s1.76×
Parse recorder — anchor heavy102.75 MB/s53.49 MB/s1.92×
Emit — anchor heavy165.62 MB/s53.49 MB/s3.10×
Parse DOM — deep nesting479.98 MB/s152.02 MB/s3.16×
Parse pull — deep nesting381.43 MB/s152.02 MB/s2.51×
Parse recorder — deep nesting443.92 MB/s152.02 MB/s2.92×
Emit — deep nesting637.1 MB/s152.02 MB/s4.19×
Parse DOM — wide mapping191.46 MB/s58.56 MB/s3.27×
Parse pull — wide mapping157.46 MB/s58.56 MB/s2.69×
Parse recorder — wide mapping177.15 MB/s58.56 MB/s3.02×
Emit — wide mapping160.29 MB/s58.56 MB/s2.74×
Parse DOM — realworld suite88.42 MB/s42.43 MB/s2.08×
Parse pull — realworld suite77.5 MB/s42.43 MB/s1.83×
Parse recorder — realworld suite89.32 MB/s42.43 MB/s2.11×
Emit — realworld suite140.17 MB/s42.43 MB/s3.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.

operationleptris sideryml 0.16.0standing
Head-to-head DOM — block heavyryml 0.16.0 (f8ac8dd)0.73×
Head-to-head DOM — scalar heavyryml 0.16.0 (f8ac8dd)0.84×
Head-to-head DOM — anchor heavyryml 0.16.0 (f8ac8dd)0.62×
Head-to-head DOM — deep nestingryml 0.16.0 (f8ac8dd)1.05×
Head-to-head DOM — wide mappingryml 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.

operationleptris sideversusstanding
Head-to-head DOM — anchor heavyryml 0.16.0 (f8ac8dd)0.62×
Head-to-head DOM — block heavyryml 0.16.0 (f8ac8dd)0.73×
Head-to-head DOM — scalar heavyryml 0.16.0 (f8ac8dd)0.84×