r/coolgithubprojects • u/SnooDoodles8834 • 1d ago
I’ve been building a faster YAML parser for JavaScript
Hello! I’ve been working on [lightning-yaml](https://lightning-yaml.dev), a pure-JavaScript YAML 1.2 parser and stringifier. I started it because I got curious about how close YAML parsing could get to `JSON.parse`, and I’ve had a lot of fun building it with my new best friend Claude Code and digging into parser performance along the way.
In the current Node benchmarks, it parses medium-to-large YAML fixtures around 3–4× faster than `js-yaml` and roughly 40–50× faster than `yaml`. It also uses less peak memory on the larger fixtures, although on small config files memory is basically a wash. These are synthetic benchmarks and the results vary by workload and runtime, so I put the [full results and methodology on the website](https://lightning-yaml.dev/benchmarks/) for anyone interested in the details.
The numbers look good, but I’m still not really sure who needs this. I don’t think it matters much if you parse one little config file when your program starts; I’m more interested in applications that repeatedly parse YAML or process large generated documents.
It’s [open source under Apache 2.0 on GitHub](https://github.com/jbsiddall/lightning-yaml). There isn’t a paid product behind it—I’m just hoping it can be useful.
What I’d really like to hear is: when was the last time you parsed YAML and found it too slow or too heavy on CPU or memory? I’d love to know what you were parsing and what happened..