X↓XMarkdown0.2GitHub
XMARKDOWN / DOCUMENTATION

Parser benchmark results

Local prototype measurements. Run timestamp: 2026-11-08T12:19:21.836Z.

Runtime: v22.22.0, win32/x64. Baseline: markdown-it 14.3.3. Chunk size: 64 UTF-16 code units.

Batch and streaming speed ratios

Workload Source code units markdown-it batch ms XMarkdown batch ms Batch speed ratio Stream vs repeated XMarkdown Stream vs repeated markdown-it
short prose 510 0.03 0.05 0.64× 1.51× 1.43×
long prose 27,751 1.03 1.26 0.82× 74.79× 64.20×
code and tables 12,900 0.56 0.67 0.85× 22.89× 22.59×
long list 16,000 1.30 1.36 0.96× 29.15× 28.10×
graphics report 17,750 0.45 0.56 0.81× 41.75× Different features

Batch ratio is baseline time / XMarkdown time: less than 1 means XMarkdown is slower. Streaming ratios compare a complete workflow of reparsing every growing prefix with section previews and one final full parse. They are not single-parse speedups.

Complete streaming workflow timings

Workload Repeated XMarkdown ms Incremental XMarkdown ms Repeated markdown-it ms Chunks Incremental submitted input
short prose 0.13 0.09 0.13 8 2.67N
long prose 306.62 4.10 263.18 434 2.99N
code and tables 62.59 2.73 61.77 202 2.87N
long list 152.14 5.22 146.69 250 3.40N
graphics report 71.98 1.72 — 278 2.50N

Method and limitations

Reused parser instances and bounded extension cache; hydrated tokens, no HTML rendering; 60 interleaved batch warmups, two streaming warmups, seven timed trials with rotating condition order; median per operation. Streaming compares full-prefix parsing on every chunk with provisional section patches plus one full final parse. Repeated graphic specifications can hit the cache in all XMarkdown conditions. Graphics baseline has unequal features; only the same-XMarkdown stream comparison is used there. See features-report.md for cold and cached rendering costs.

Reproduce with npm run bench. Set XMARKDOWN_CHUNK_SIZE to test a different delivery size. The benchmark source is run.js.

View original on GitHub ↗