Repository navigation
feat(site): benchmark figures were typed in by hand and could go stale - #4
Merged
Merged
Conversation
apps/site/src/data/benchmarks.ts held 27 figures copied from the docs, and sentences like "ahead on all thirteen" or "less memory on every page" that nothing checked against them. The figures now come from the newest run in Parsec's bench/results/, written by the bench's --json and read when the site is built. A file with the wrong schema, or a figure a page needs and the run lacks, fails the build. Every claim about who wins is worked out from the same figures, so a run where it no longer holds changes the sentence. PARSEC_BENCH_RESULTS points the build at a local run instead. The Benchmarks and Real-world benchmarks docs pages move to the same run, 29 November 2026: the real-world tables are the new run's output, over the fresh 1,746-page list, and the Benchmarks page's summary and note say which run the site quotes and how to make one.
jamesconwaydev
enabled auto-merge (squash)
November 29, 2026 06:57
This was referenced Nov 29, 2026
Merged
foothillsdigital
approved these changes
Nov 29, 2026
foothillsdigital
left a comment
Collaborator
There was a problem hiding this comment.
Approving 875e65a, with one cosmetic nit.
- Build:
pnpm --filter site buildreadsbench/results/2026-11-29-m2-max/from Parsec's main and builds 19 pages.astro checkshows 0 errors and 0 warnings. - The rendered pages match the JSON. Among them: 362 vs 242 and 83 MB/s; 1,746 pages at 1,007 vs 543 MB/s; "Lexbor was faster on 8 of them"; "with less memory on 9 of them", which is 13 minus the four where Parsec is higher; 243 vs 715 ms for selectors; 373 vs 358 and 156 MB/s for JavaScript; oxc still ahead on the smallest inline scripts; and neither parser crashing on the real-world run.
- No old figure is left.
grepoverdistfor370 MB,933,1,731and13 of 1finds nothing. - It fails closed, as the description says:
- with
PARSEC_BENCH_RESULTSpointed at a copy of the run that lacks the "all real pages" figures, the build stops withbench/results pages.json has no html / all real pages / Parsec / seconds; - with a file's
schemaset to 2, it stops withrealworld.json: schema 2, this site reads 1.
- with
Nit: the figures from the loader print without a thousands separator, so /parsec-vs-lexbor/ says "1,746 production pages … 1007 MB/s against 543", and /netweir/ says "Parsec at 1007 MB/s", next to counts that do have one. The README (#261) writes "1,007". Running the loader's numbers through the same toLocaleString('en-US') the page counts use would make them match.
Working the sentences out from the figures, so a run where a claim stops holding changes the wording, is the part that'll keep paying off.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
apps/site/src/data/benchmarks.tsheld 27 figures typed in from the docs under twoshortcut:comments. The pages also made claims nothing checked against them: "ahead on all thirteen", "less memory on every page", "Lexbor was faster on 13", "All three agree on every one". Since parsec-html/parsec#259, Parsec's bench writes its figures as JSON, and a full run of 29 November 2026 is committed underbench/results/.Change
benchmarks.tsis now a loader. At build time it listsbench/results/on Parsec's main through the GitHub API, takes the newest directory, and reads each mode's file. A file whoseschemaisn't 1, a figure that isn't{bench, source, bytes, parser, metric, value}, or a figure a page needs that the run lacks fails the build. The hand-copied constants and bothshortcut:comments are gone.Claims are worked out from the figures:
A run where a claim stops holding changes the sentence, not just the number. Page counts, stylesheet counts, versions, machine and dates come from the run too.
Pages that read it: /benchmarks/, /parsec-vs-lexbor/, the homepage, /netweir/ and /benchmarks/methodology/, which also explains
--jsonand linksbench/results.PARSEC_BENCH_RESULTS=/path/to/runbuilds against a local run before it's on main.Docs:
--json.What changes on the pages
Tests
pnpm buildandpnpm checkon both apps, against Parsec's main: 0 errors.scripts/check-links.mjsis clean on bothdists.