Skip to content

Commit 7d5e036

Browse files
hsbtclaude
andcommitted
Note libfyaml performance and when to prefer libyaml
Record the rough parse/emit benchmark so users pick the backend on purpose: libfyaml is for YAML 1.2 semantics, and libyaml stays the choice when emit throughput matters since libfyaml dumps about 1.7x to 1.9x slower. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 23e5c66 commit 7d5e036

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ byte-for-byte output is not guaranteed to match. On a parse error,
102102
`Psych::SyntaxError#context` is always `nil`, whereas libyaml splits the
103103
description across `#problem` and `#context`.
104104

105+
This backend targets YAML 1.2 compliance, not speed. In a rough
106+
single-machine benchmark that loads and dumps in-memory documents, parsing
107+
was roughly on par with libyaml (sometimes faster on string-heavy input),
108+
while emitting was about 1.7x to 1.9x slower. Your numbers will vary, but the
109+
shape holds: libfyaml is competitive at parsing and slower at emitting. Use
110+
this backend when you need YAML 1.2 semantics. If throughput is your priority,
111+
keep using the default libyaml backend.
112+
105113
## Release
106114

107115
We used the trusted publisher and [rubygems/release-gem](https://github.com/rubygems/release-gem) workflow.

0 commit comments

Comments
 (0)