Back to browse
GitHub Repository

Fully feature complete YAML parser and emitter, supporting the latest YAML spec and passing the full YAML testsuite.

334 starsC

Libfyaml adds a YAML/JSON parse cache; 427 MB reloads in 36 ms

by fypanto·May 28, 2026·3 points·0 comments

AI Analysis

●●●BangerBig BrainWizardry

473x faster YAML parsing via mmap cache with near-zero memory on hot reload.

Strengths
  • mmap-based generic arena avoids relocation and keeps RSS essentially zero on cache hits
  • 473x speedup (16.98s to 36ms) on 427MB files is measurable and significant
  • Transparent cache requires no code changes for existing libfyaml users
Weaknesses
  • Only benefits repeated reads of stable files, not dynamic workloads
  • Niche use case limited to startup/config loading scenarios
Target Audience

Backend developers working with large configuration or data files

Similar To

libyaml · yaml-cpp · serde_yaml

Post Description

libfyaml 1.0.0-alpha7 adds an opt-in transparent parse cache for repeated reads of stable YAML/JSON files.

It is not making the parser itself hundreds of times faster. On a cache hit, libfyaml mmaps the generic arena and directly uses that instead of parsing the file. Due to the design of the generic subsystem it even avoids relocation and in 64bit systems with ASLR.

Benchmark run using the python binding on AllPrintings.json sized 427.5 MB.

- cache off: 16.98 s, +13.4 GB RSS - cold cache: 22.45 s, +13.4 GB RSS - hot cache: 35.9 ms, +1.0 MB RSS

That is about 473x faster on the hot-cache path versus a normal parse, with a much smaller memory delta. Also note how the RSS is essentially zero; the generic data in the arena are not even faulted in.

This is intended for startup/config/data-loading workloads where the same large YAML or JSON file is read repeatedly.

Benchmark commit: https://github.com/pantoniou/libfyaml/commit/f150432b36e409a...

Similar Projects