Skip to content

Real-world benchmarks

Parsec, Lexbor and html5ever, run over 1,746 production pages as a crawler fetches them. Each parser gets the raw bytes and the Content-Type charset. Parsec gets through the corpus at 1,007 MB/s and Lexbor at 543, so Parsec is 1.85 times as fast. Parsec’s median page takes 0.19 ms and Lexbor’s 0.33 ms. Neither parser crashed or timed out on any page, and the three parsers built the same number of elements on every page. Lexbor is faster on 8 pages, all under 70 KB, and html5ever’s process peaks 9 MB lower than Parsec’s. The tables below have the rest, broken down by encoding, by language and by size.

The Benchmarks page times 13 hand-picked pages and the final boss’s seeded batch. Both are chosen. This page is the web as it came back from a crawl on one day, with nothing chosen and nothing tidied. That covers the Shift_JIS novel and the 13.3 MB news home page as well as the 300-byte redirect stub that some sites serve as their home page.

The pages come from Netweir’s real-world harness, bench/realworld/ in netweir/netweir. Its pick.py chose two kinds of URL:

  • Home pages from Tranco list 46YVX, made on 20 November 2026. These come from the top 100,000 pay-level domains. Each public suffix gets a share of picks that grows with the square root of how many of those domains it has, so .com doesn’t crowd out .de, .co.jp or .gov.uk. CDNs, trackers and adult sites are left out by name.
  • Inner pages picked by hand for the kinds of page a home page isn’t: articles, docs, forum threads, product pages and legacy encodings.

bench/fetch-realworld.sh --urls fetched all 2,709 listed URLs on 29 November 2026, the way Netweir’s run.py does: robots.txt for every redirect, one request at a time to each host with a second between them, and the project named in its User-Agent. Of those URLs, 1,746 came back as 200 HTML, 563.4 MB in all, with 1,699 distinct bodies. Some URLs redirect to the same page. The rest were left alone for robots.txt (99), were unreachable or redirected more than five times (562), returned a status other than 200 (298), or weren’t HTML (4).

bench/realworld.tsv lists each page’s URL, the SHA-256 of the body after Content-Encoding, the time it was fetched (UTC) and its Content-Type header. The pages belong to their sites, so the repository holds this list and never the bodies.

cargo run --release --manifest-path bench/Cargo.toml -- realworld reads the list and the bodies in bench/corpus/realworld/, which are named by their SHA-256. Each page goes through the final boss’s machinery:

  • Parsec: parsec_encoding::parse_bytes, with Options::transport set from the charset in Content-Type. That’s the browser’s algorithm: BOM, transport, prescan, UTF-8 detection, windows-1252, and a second parse if a later <meta> changes the encoding.
  • Lexbor 3.0.1, built from its release tag: its own BOM sniff, the transport label, its <meta> prescan of the first 1,024 bytes, then windows-1252. Lexbor’s encoding module decodes anything that isn’t UTF-8, and then lxb_html_document_parse parses the result. UTF-8, and ASCII in an encoding that keeps ASCII, go straight to the parser.
  • html5ever 0.40.1 takes text, so encoding_rs decodes the bytes for it first, using Parsec’s sniffing and no second parse. That decode is inside its time.

Each parser runs in its own processes. A feeder process sends the pages one at a time over a pipe to a worker. The worker times each page from bytes to a finished document, then counts its elements and frees it outside the timed part. A page still parsing after 10 seconds counts as a timeout. A crash or a timeout costs that one page, and a new worker picks up at the next one. Peak RSS is getrusage(RUSAGE_CHILDREN)’s ru_maxrss across one parser’s workers. It includes the one buffer each worker reuses for every page, which grows to the biggest page, 13.3 MB.

Each parser does three runs. Before each run the bench waits for the one-minute load average to drop below 3, and a different parser goes first each time. A page’s time is the median of its three runs. A parser’s total is the median of its three run totals. MB/s is bytes over that total. In the breakdowns, MB/s is a group’s bytes over the sum of its pages’ median times.

Each page is parsed once per run, the way a crawler meets it, not 30 times on a warm cache as on the Benchmarks page. Expect noisier times on small pages here, and higher MB/s on big ones. Many of the big pages are mostly script or JSON in a few text nodes, and every parser gets through those fast.

Parser Total MB/s p50 p90 p99 Slowest Peak RSS Crashes Timeouts Refused
Parsec 0.56 s 1007 0.19 ms 0.72 ms 2.61 ms 5.25 ms 101 MB 0 0 0
Lexbor 1.04 s 543 0.33 ms 1.35 ms 4.64 ms 14.60 ms 113 MB 0 0 0
html5ever 3.40 s 166 1.11 ms 4.50 ms 14.38 ms 30.37 ms 92 MB 0 0 0

p50, p90 and p99 are per-page times across the 1,746 pages. Slowest is the single slowest page.

Element counts: Lexbor and html5ever each built the same number of elements as Parsec on every page. None of the three refused a page, crashed or timed out. The load average was 1.74 to 1.93 at the start of each run.

Pages MB Parsec MB/s Lexbor MB/s html5ever MB/s Parsec vs Lexbor
UTF-8 1525 544.1 1008 550 165 1.83x
windows-1252 205 16.5 1897 717 288 2.65x
Shift_JIS 8 1.5 246 128 71 1.93x
windows-1251 3 0.3 200 91 60 2.19x
windows-1250 2 0.4 385 135 73 2.86x
KOI8-R 1 0.0 132 76 40 1.74x
ISO-8859-15 1 0.5 812 159 146 5.11x
windows-1256 1 0.0 45 33 21 1.37x
Pages MB Parsec MB/s Lexbor MB/s html5ever MB/s Parsec vs Lexbor
en 963 285.7 1118 588 180 1.90x
none 183 31.6 758 421 147 1.80x
es 80 30.7 1145 535 184 2.14x
ja 57 27.0 1056 536 179 1.97x
ru 50 16.2 823 462 136 1.78x
pt 38 15.0 1026 576 164 1.78x
de 35 22.3 877 498 132 1.76x
fr 28 13.3 1229 651 187 1.89x
ar 27 8.5 868 515 148 1.69x
zh 25 6.9 656 404 123 1.62x
tr 22 5.2 835 491 140 1.70x
ko 21 8.3 709 430 123 1.65x
id 17 3.1 710 429 122 1.66x
vi 15 6.4 591 358 103 1.65x
it 14 7.7 913 527 144 1.73x
pl 13 7.4 1015 568 167 1.79x
uk 13 4.5 1217 638 202 1.91x
fa 10 2.6 795 490 141 1.62x
nl 9 3.1 1292 650 196 1.99x
th 8 3.3 921 564 171 1.63x
el 8 4.4 659 412 116 1.60x
he 7 3.2 1048 570 168 1.84x
hu 6 7.2 1626 723 258 2.25x
da 6 3.4 1022 594 153 1.72x
cs 6 3.5 941 456 158 2.06x
39 more 85 32.7 943 539 157 1.75x
Pages MB Parsec MB/s Lexbor MB/s html5ever MB/s Parsec vs Lexbor
under 10 KB 137 0.5 285 186 76 1.53x
10-100 KB 617 37.8 722 420 135 1.72x
100 KB-1 MB 874 305.5 853 479 144 1.78x
1-10 MB 117 206.4 1465 710 216 2.06x
over 10 MB 1 13.3 2529 910 437 2.78x
Page Size Encoding Parsec Lexbor html5ever
https://web.nhk/ 13283 KB UTF-8 5.25 ms 14.60 ms 30.37 ms
https://kqbd.mobi/ 2093 KB UTF-8 4.74 ms 7.80 ms 27.25 ms
https://ru.wikipedia.org/wiki/Москва 1977 KB UTF-8 4.10 ms 6.32 ms 25.74 ms
https://de.wikipedia.org/wiki/Berlin 1744 KB UTF-8 3.84 ms 6.48 ms 23.25 ms
https://nodejs.org/api/fs.html 1109 KB UTF-8 3.74 ms 5.40 ms 15.59 ms
https://www.aozora.gr.jp/cards/000148/files/773_14560.html 618 KB Shift_JIS 3.68 ms 6.04 ms 10.08 ms
https://en.wikipedia.org/wiki/Tokyo 1786 KB UTF-8 3.49 ms 5.73 ms 24.27 ms
https://www.chosun.com/ 3084 KB UTF-8 3.27 ms 5.34 ms 18.15 ms
https://cnn.com/ 7295 KB UTF-8 3.26 ms 7.82 ms 21.32 ms
https://www.allbirds.com/collections/mens 3354 KB UTF-8 3.24 ms 5.85 ms 29.30 ms

Lexbor parses 8 of 1746 pages faster than Parsec; Parsec spends 0.04 ms more than Lexbor on them in all. Those that lose the most time:

Page Size Encoding Parsec Lexbor html5ever
https://quickconnect.to/ 67 KB UTF-8 0.11 ms 0.09 ms 0.16 ms
https://nyaa.vc/ 1 KB UTF-8 0.02 ms 0.01 ms 0.02 ms
https://mega.nz/ 3 KB UTF-8 0.03 ms 0.02 ms 0.05 ms
https://verify.hn/ 0 KB windows-1252 0.01 ms 0.00 ms 0.00 ms
https://www.cs.cmu.edu/~rgs/alice-table.html 3 KB windows-1252 0.02 ms 0.01 ms 0.04 ms
https://imss.gob.mx/ 0 KB windows-1252 0.01 ms 0.01 ms 0.01 ms
http://info.cern.ch/hypertext/WWW/TheProject.html 2 KB windows-1252 0.03 ms 0.03 ms 0.06 ms
https://blackrussia.online/ 2 KB windows-1252 0.01 ms 0.01 ms 0.02 ms

html5ever parses 4 of 1746 pages faster than Parsec.

Element counts that differ from Parsec’s

Section titled “Element counts that differ from Parsec’s”

Lexbor: 0 pages.

html5ever: 0 pages.

  • Memory, against html5ever. html5ever’s workers peaked at 92 MB and Parsec’s at 101 MB. Lexbor’s peaked at 113 MB. That’s one number per run, set by the biggest pages, so it says little about a typical page. Still, Parsec doesn’t win it here.
  • Tiny pages, against Lexbor. Lexbor is faster on 8 pages, all under 70 KB and most under 3 KB. Parsec loses 0.04 ms on all 8 together, a few microseconds each, which is about the size of the timer’s noise at this scale. The lead is narrowest under 10 KB (1.53 times, against 2.06 times from 1 to 10 MB). That’s where fixed per-document costs weigh most.
  • windows-1256. On its one page Parsec is only 1.37 times as fast as Lexbor, and both parsers run far below their usual MB/s. A single small page proves little, but it’s the narrowest group in the tables.
  • Against html5ever on four pages. html5ever beat Parsec on 4 pages.
  • One day of the web. Pages change by the hour. google.com served different bytes two hours later. Rerun bench/fetch-realworld.sh and some pages will have changed. Those are left out rather than replaced, so the comparison stays like for like.
  • Language comes from <html lang>, as the page states it. 183 pages have none, and some sites state the wrong one. The script family is not checked.
  • Encodings are as Parsec decided them. Lexbor’s sniffing can land on a different encoding, for example when a page needs UTF-8 detection, which Lexbor 3.0.1 doesn’t have. The element counts still agreed on every page.
  • The pages are mostly UTF-8. That is 1,525 of the 1,746. The legacy-encoding rows have few pages, and the final boss covers those encodings on purpose.
Terminal window
git clone --recurse-submodules https://github.com/parsec-html/parsec
cd parsec
bench/fetch-realworld.sh
cargo run --release --manifest-path bench/Cargo.toml -- realworld > report.md

bench/fetch-realworld.sh fetches the listed pages into bench/corpus/realworld/. It fetches the way Netweir’s harness does: robots.txt for every redirect, one request at a time to each host with a second between them (or the Crawl-delay, up to 10 s), sixteen hosts at once, a 20 s timeout, and the User-Agent parsec-realworld/1.0 (+https://github.com/parsec-html/parsec). It keeps a page only if its SHA-256 still matches the list, and prints how many pages changed. The benchmark then reports how many listed pages it left out.

To build a fresh list from Netweir’s bench/realworld/urls.txt, run bench/fetch-realworld.sh --urls urls.txt > list.tsv. That fetches every URL, keeps what comes back as 200 HTML, and prints new manifest lines. Then point the benchmark at it with -- realworld --manifest list.tsv. --runs N, --tools parsec,lexbor and --now (don’t wait for a quiet machine) change the rest.

The tables above are the benchmark’s output as it printed it. Add --json realworld.json to write every figure in them, with the machine, the load and the versions, as bench/results/ keeps them. You need CMake and a C compiler for Lexbor, and Python 3.11 or later for the fetch script.