DEV Community

Cover image for 40x faster than Pandoc, byte-identical: Weavon checked
frank chu
frank chu

Posted on

40x faster than Pandoc, byte-identical: Weavon checked

Weavon converted my 1 MB Markdown file to HTML in 149 ms. Pandoc 3.13 took 5,602 ms on the same machine — and the two outputs were byte-identical.

Weavon v0.2.0 landed on Hacker News yesterday claiming to be a drop-in Pandoc 3.13 replacement in safe Rust: 99.93% parity (65,891 of 65,937 baseline test units), 15–50x faster, one 9.3 MB binary. Those are exactly the kind of claims that are cheap to check, so I checked the parts I could.

Setup

I downloaded the official Linux x86_64 release binaries for both tools — Weavon v0.2.0 (released December 4) and Pandoc 3.13, the exact version Weavon targets. No building, no tuning.

First surprise is just the file sizes:

weavon  13,695,232 bytes
pandoc 168,374,480 bytes
Enter fullscreen mode Exit fullscreen mode

Pandoc's binary is 12.3x larger. Weavon's README is honest about this, by the way: the 9.26 MB headline number is macOS ARM64; Linux x86_64 is 13.70 MB, which matches my download to the byte.

The benchmark

I generated a 1,000,020-byte Markdown document — 1,630 repeated sections, each with headings, emphasis, links, inline code, inline math, nested lists, a table, a fenced code block, a blockquote, and a footnote. Then I ran four conversions, seven times each, and took medians:

Conversion Weavon Pandoc 3.13 Speedup Output identical?
md → html 149 ms 5,602 ms 37.6x yes, 2,902,168 bytes
md → html, no highlight 119 ms 4,755 ms 40.0x yes, 2,270,373 bytes
md → json 94 ms 3,074 ms 32.8x yes, 6,406,265 bytes
md → latex 142 ms 4,652 ms 32.8x yes, 1,869,919 bytes

"Identical" here means identical SHA-256, not "looks the same." All four outputs matched byte for byte, including the syntax-highlighted HTML, which is usually where reimplementations quietly diverge.

The claimed range was 15–50x. My numbers land at 32.8–40.0x, inside the claim, on a slow shared VM where the absolute times are much worse than their Apple Silicon numbers. The ratio survived the worse hardware; that's the part that matters.

Startup is a smaller win: --version median 1.52 ms vs 2.96 ms. If your pipeline shells out to Pandoc per file, that 2x is real but it's not the story.

Format lists

$ weavon --list-input-formats | wc -l    # 54
$ pandoc --list-input-formats | wc -l    # 52
$ weavon --list-output-formats | wc -l   # 83
$ pandoc --list-output-formats | wc -l   # 77
Enter fullscreen mode Exit fullscreen mode

Weavon's lists are strict supersets on my machine: it adds obsidian and pdf inputs, plus six Markdown-flavored outputs (hugo-md, mkdocs-md, myst-md, starlight-md, docusaurus-mdx, llm-markdown), and drops nothing. A format appearing in a list isn't proof it converts correctly, but "drop-in" tools usually fail this test in the other direction.

PDF without TeX

The v0.2.0 headline feature is --pdf-engine=embedded. A small document with math and a table became a 12,913-byte PDF 1.7 file in 29 ms, with no TeX installation involved. I didn't validate the rendering quality beyond the file being a well-formed PDF, but the "PDF without a 4 GB TeX install" pitch at least mechanically works.

What I didn't verify

My document is synthetic and repetitive; real documents have uglier edge cases, and that's what their 65,937-unit conformance harness is for. I did not re-run that harness, so the 99.93% parity figure remains their number, not mine. I also didn't test Lua filters, citeproc, or docx round-trips.

But the falsifiable core of the pitch — much smaller binary, 15–50x faster, same output — held up on the first try. Reimplementing Pandoc in Rust sounded like a multi-year yak-shave. Apparently someone did the yak-shaving, and the result is 40x faster on my file.

Sources

Top comments (0)