Benchmarks
Speed, memory, and spec-conformance for Lightning YAML against the other parsers this
repo benchmarks itself against: js-yaml, yaml (eemeli), and the JSON baseline where a
workload is JSON-shaped enough for it to compete. Every chart below is a static image —
inline SVG rendered at build time, no client JavaScript.
Measured on Intel(R) Xeon(R) Processor @ 2.80GHz (~1.53 GHz) · node 22.22.2 (x64-linux) · generated 2026-07-13 · source README.md@6b0c56e
These numbers are a hand-captured, representative snapshot — not a live feed. Once the CI
benchmark job is wired up to publish runs to the benchmark-data branch, this page will
read that history automatically and the charts will track it without further changes.
Parse time
Section titled “Parse time”Parse time by workload
Lower is better. Bars are proportional to time; each workload is scaled to its own slowest parser (rows span microseconds to seconds, so compare bars within a row, not across rows). Avg wall time per parse() call.
- JSON
- js-yaml
- yaml (eemeli)
- Lightning YAML
A curated size progression (small through xlarge) plus one yaml-rich workload
(anchors and !!binary, where only yaml and lightning-yaml can run at all) — the full
13-workload breakdown is in the summary table below.
Stringify time
Section titled “Stringify time”Stringify time by workload
Lower is better. Bars are proportional to time; each workload is scaled to its own slowest parser (rows span microseconds to seconds, so compare bars within a row, not across rows). Avg wall time per stringify() call.
- JSON
- js-yaml
- yaml (eemeli)
- Lightning YAML
Peak memory
Section titled “Peak memory”Peak memory by workload (parse)
Lower is better. Bars are proportional to peak RSS; each workload is scaled to its own slowest parser, so compare bars within a row, not across rows. Peak resident set size, fixed at 25 iterations.
- JSON
- js-yaml
- yaml (eemeli)
- Lightning YAML
Conformance
Section titled “Conformance”YAML test-suite conformance
Higher is better. Pass rate across 373 cases from the official yaml-test-suite.
lightning-yaml passes 97.6% of the suite — including all 91 negative (should-fail)
cases — ahead of yaml at 97.1% and js-yaml at 94.9%. Merge keys (<<), absent from the
test corpus, are the only unimplemented construct.
Summary
Section titled “Summary”Every parse-time workload, all four libraries, avg ns per iteration (— where a library
can’t read that workload):
| Workload | JSON | js-yaml | yaml (eemeli) | Lightning YAML |
|---|---|---|---|---|
| small-records | 6.75 µs | 65.8 µs | 680 µs | 15.6 µs |
| medium-records | 767 µs | 6.57 ms | 83.0 ms | 1.54 ms |
| large-records | 8.56 ms | 104 ms | 964 ms | 19.2 ms |
| xlarge-records | 97.5 ms | 998 ms | 9.89 s | 196 ms |
| medium-nested | 1.51 ms | 11.8 ms | 130 ms | 2.94 ms |
| large-nested | 10.9 ms | 112 ms | 931 ms | 22.2 ms |
| yaml-plain-small-records | — | 65.9 µs | 749 µs | 20.3 µs |
| yaml-plain-medium-records | — | 7.78 ms | 103 ms | 2.44 ms |
| yaml-plain-large-records | — | 112 ms | 1.01 s | 25.7 ms |
| yaml-plain-medium-nested | — | 3.82 ms | 59.4 ms | 1.33 ms |
| yaml-rich-small | — | — | 1.04 ms | 30.2 µs |
| yaml-rich-medium | — | — | 85.3 ms | 2.36 ms |
| yaml-rich-large | — | — | 1.18 s | 21.2 ms |
Conformance, 373 cases from the yaml-test-suite:
| Library | Passed | Total | Score |
|---|---|---|---|
| Lightning YAML | 364 | 373 | 97.6% |
| yaml (eemeli) | 362 | 373 | 97.1% |
| js-yaml | 354 | 373 | 94.9% |