1. YJIT (recommended, enabled by default in the CLI)
Uniword’s hydration pipeline is dispatch-heavy Ruby and runs ~1.75x faster under YJIT (measured on the standard 608 KB corpus: 8.3 s → 4.7 s CPU). The uniword CLI enables YJIT automatically since 1.6.0; opt out with:
UNIWORD_DISABLE_YJIT=1 uniword convert input.docx output.html
Library consumers get the same win by running Ruby with YJIT:
RUBYOPT="--yjit" ruby my_script.rb
2. Benchmarking
A deterministic benchmark ships with the repository and runs on every PR (single job, per-PR concurrency — new pushes cancel superseded runs):
bundle exec rake benchmark # 5 iterations
BENCH_ITERATIONS=10 bundle exec rake benchmark
It generates a fixed ~600 KB WordprocessingML corpus and measures three cases:
| Case | Meaning |
|---|---|
|
Raw XML-engine parse of the corpus — the floor. |
|
End-to-end hydration ( |
|
|
Each case reports wall time, CPU time (the primary comparison metric — wall time on shared runners swings ±40–75% with neighbor load while CPU time stays within ±4%), allocations per iteration, and RSS delta. Results are also written as JSON artifacts on CI.