corpus #
The corpus is the set of files the libraries are run on. It lives in bench/corpus/, and its manifest records what each input is and where it came
from. Every input is listed at the end of this page, with its upstream commit where it has
one.
Sources #
Every input is labeled by its source, in its path and in every result:
| source | what it holds |
|---|---|
neutral | real files from projects no measured library authored, copied unmodified at a pinned commit: the primary set |
shiki | the sample files Shiki's own benchmark uses, at a pinned commit |
home | a measured library's own samples, labeled with the library: fuz_code's test fixtures, and the corpus Twinkleplop benchmarks itself on |
harness | one short snippet for each language, written for this benchmark by its maintainer, who also maintains fuz_code |
stress | inputs that look for each library's worst cases: neutral inputs minified, and pathological files generated here by the maintainer, who also maintains fuz_code |
The neutral set has a small, a medium, and a large file for each timed language. The other sources are kept so a reader can see whether a result holds on inputs a library chose for itself, or on hostile ones, and the results page filters by source. No summary pools two sources. A home input is always shown under the library whose samples it is, and libraries' home inputs are never summarized together: they contributed very different amounts.
Stress inputs #
The stress inputs are generated by a script in the repository, bench/corpus_stress.ts, and none is tuned to a library. A library that fails on
one, or is far slower there than anywhere else, is a finding: it is shown, as an exclusion
with its reason or as the slow number, never smoothed over by changing the input. They come in
two kinds:
- derived — a neutral input as real code ships: the JS and the CSS minified by esbuild, and the JSON serialized with no whitespace, each one long line. It keeps its source's pins, is marked synthetic, and names how it was made, with the esbuild version, since another version may minify to other bytes
- written — a pathological file for each timed language: nesting far deeper than code is written, a line of TypeScript tens of KB long, an unterminated string and block comment near the top of a file, template literals nested in their substitutions, Markdown delimiters that never close, HTML tags that never close and attributes without quotes, and a selector list on one long line. Each says in its first comment what it stresses
Shiki is timed with its per-line time limit out of reach, as on every input, so on a stress input it highlights every line in full. With its default limit a line that slow comes back with its rest as plain text, so a consumer with default options gets that fallback there rather than the stress number.
Size tiers #
An input's tier comes from its size in bytes, never from its name:
| tier | size |
|---|---|
micro | under 600 bytes |
small | 600 bytes to under 3,200 |
medium | 3,200 bytes to under 32,000 |
large | 32,000 bytes and over |
The upper three center on roughly 1KB, 10KB, and 100KB. The micro tier is the docs-site case: a snippet of a few lines, where the fixed cost of a call outweighs the scanning. The large tier has no upper bound, and the neutral large inputs range from about 90KB to several hundred KB, so compare throughput in MB/s across languages, not time per call.
Synthetic inputs #
An input is marked synthetic when it is not one real file as published but was built by joining or repeating files to reach its size, or derived from one, as the minified stress inputs are. Real files are preferred. Most of Twinkleplop's own corpus is built this way and is marked.
One neutral input is synthetic: the large Svelte file. Svelte components of around 100KB are rare, so a script builds one from several real components of other projects. It splits each component into its scripts, markup, and style, and writes one of each block holding the bodies in order, unchanged. The result is shaped like one large component and is lexically well formed, but it is not a working component: unrelated scripts share one scope, so their names collide and Svelte's parser rejects it. No source is rewritten to avoid that. The manifest lists every component it is built from.
The manifest #
bench/corpus/manifest.json holds one BenchInput for
each input: its path, source, language, tier, size in bytes and lines, SHA-256, whether it is
synthetic, and its provenance. A results file carries the same entries for the inputs it
measured, described in results file.
Provenance is a list of BenchProvenance pins, each a repository, a commit, a path, a hash, and a license:
- none, for a harness snippet or a stress input written here
- one, for a verbatim copy, whose hash must equal the input's; the copy is still marked synthetic when its upstream built it by joining files
- one, for a derived stress input, whose
derivationnames the transformation that made it from that file - several, for a synthetic input, naming what it was built from
The manifest also holds a hash over the whole corpus. A run records it, so two runs over different inputs are never compared as one.
Checking and regenerating #
npm run corpus:check # the manifest matches the files, and every copy its pin
npm run corpus:manifest # regenerate the manifest and the table of inputs
npm run corpus:fetch # download neutral inputs by their pins, verifying each
npm run corpus:harvest -- --repos <dir> --check # the synthetic Svelte input matches its sources
npm run corpus:stress # regenerate the stress inputs and the manifest
npm run corpus:stress -- --check # the stress inputs are what generates Sizes, line counts, hashes, and tiers are derived from the files. The synthetic flag, the provenance, and the derivation are written by hand, or by the stress generator for its own inputs, and carried forward. The tests rebuild the manifest from disk and compare it to the committed one, so a file added, removed, or changed without regenerating fails. The tests also regenerate the stress inputs and compare them with the files.
The corpus is data: no formatter, linter, or type checker runs on it, since a reformatted file is no longer the upstream file.
Inputs #
Every input of the results this site renders, by source. The corpus hash of those results is e649d70d435efac06e26c753d9424bbf30122fcae8e8037396b3cc340ea1c101. The repository holds the same list as a table generated from the manifest.
| input | language | tier | bytes | lines | license | upstream, at its pinned commit |
|---|---|---|---|---|---|---|
neutral/bash/headerscheck | bash | medium | 10,792 | 280 | PostgreSQL | postgres/postgres@cc053b6e12 src/tools/pginclude/headerscheck |
neutral/bash/nvm.sh | bash | large | 179,635 | 5,416 | MIT | nvm-sh/nvm@a8bb497400 nvm.sh |
neutral/bash/postgres-wrapper.sh | bash | small | 707 | 25 | PostgreSQL | postgres/postgres@cc053b6e12 contrib/start-scripts/macos/postgres-wrapper.sh |
neutral/css/bulma.css | css | large | 763,923 | 21,564 | MIT | jgthms/bulma@c5cd04baf0 css/bulma.css |
neutral/css/default.css | css | medium | 12,501 | 535 | LicenseRef-W3C-Software-and-Document-2023 | w3c/csswg-drafts@0da42c8afd shared/style/default.css |
neutral/css/text.css | css | small | 875 | 48 | MIT | sveltejs/svelte.dev@a90ebe2304 packages/site-kit/src/lib/styles/text.css |
neutral/html/index.html | html | small | 1,526 | 51 | MIT | prettier/prettier@1dcd0b05d0 website/index.html |
neutral/html/Overview.src.html | html | large | 107,712 | 2,694 | LicenseRef-W3C-Software-and-Document-2023 | w3c/csswg-drafts@0da42c8afd selectors-3/Overview.src.html |
neutral/html/results.template.html | html | medium | 18,139 | 741 | MIT | sveltejs/svelte@7bc0a70fe6 benchmarking/compare/results.template.html |
neutral/js/class.js | js | medium | 9,760 | 371 | MIT | prettier/prettier@1dcd0b05d0 src/language-js/print/class.js |
neutral/js/client.js | js | large | 91,407 | 3,160 | MIT | sveltejs/kit@55ac0d5264 packages/kit/src/runtime/client/client.js |
neutral/js/parse.js | js | small | 963 | 41 | MIT | prettier/prettier@1dcd0b05d0 src/main/parse.js |
neutral/json/ast.json | json | large | 175,037 | 5,502 | Apache-2.0 | microsoft/typescript-go@89d5d5b284 _scripts/ast.json |
neutral/json/kit.tsconfig.json | json | small | 1,048 | 29 | MIT | sveltejs/kit@55ac0d5264 packages/kit/tsconfig.json |
neutral/json/typesMap.json | json | medium | 17,285 | 497 | Apache-2.0 | microsoft/TypeScript@637d5746b7 src/server/typesMap.json |
neutral/md/02-state.md | md | medium | 10,036 | 352 | MIT | sveltejs/svelte@7bc0a70fe6 documentation/docs/02-runes/02-$state.md |
neutral/md/Explainer.md | md | large | 169,115 | 3,504 | Apache-2.0 | WebAssembly/component-model@a25fc0b372 design/mvp/Explainer.md |
neutral/md/postgres.README.md | md | small | 989 | 21 | PostgreSQL | postgres/postgres@cc053b6e12 README.md |
neutral/rust/dent.rs | rust | medium | 11,211 | 352 | Unlicense OR MIT | BurntSushi/walkdir@4f26be4d45 src/dent.rs |
neutral/rust/raw_query.rs | rust | small | 852 | 37 | MIT | tokio-rs/axum@c59208c86f axum/src/extract/raw_query.rs |
neutral/rust/table.rs | rust | large | 100,960 | 3,197 | MIT OR Apache-2.0 | rust-lang/hashbrown@c62a63a61b src/table.rs |
neutral/svelte/Breadcrumb.svelte | svelte | small | 1,141 | 44 | MIT | techniq/svelte-ux@11c79b8c6e packages/svelte-ux/src/lib/components/Breadcrumb.svelte |
neutral/svelte/harvest.svelte synthetic | svelte | large | 106,723 | 3,186 | MIT | techniq/layerchart@ec05fb1b84 packages/layerchart/src/lib/components/Legend.sveltetechniq/layerchart@ec05fb1b84 packages/layerchart/src/lib/components/layers/Canvas.sveltetechniq/svelte-ux@11c79b8c6e packages/svelte-ux/src/lib/components/Button.sveltetechniq/svelte-ux@11c79b8c6e packages/svelte-ux/src/lib/components/TextField.sveltethemesberg/flowbite-svelte@85f20a048e src/lib/datepicker/Datepicker.sveltethemesberg/flowbite-svelte@85f20a048e src/lib/clipboard-manager/ClipboardManager.svelte |
neutral/svelte/Layer.svelte | svelte | medium | 9,455 | 343 | MIT | dimfeld/svelte-maplibre@05dd0b2a76 src/lib/Layer.svelte |
neutral/ts/core.ts | ts | large | 92,419 | 2,595 | Apache-2.0 | microsoft/TypeScript@637d5746b7 src/compiler/core.ts |
neutral/ts/options.ts | ts | medium | 10,080 | 251 | MIT | sveltejs/language-tools@bf2993e192 packages/svelte-check/src/options.ts |
neutral/ts/transform.ts | ts | small | 1,160 | 27 | Apache-2.0 | microsoft/TypeScript@637d5746b7 src/services/transform.ts |
| input | language | tier | bytes | lines | license | upstream, at its pinned commit |
|---|---|---|---|---|---|---|
shiki/bash/shellscript.sample | bash | small | 661 | 28 | MIT | shikijs/textmate-grammars-themes@45e292ef67 samples/shellscript.sample |
shiki/css/css.sample | css | micro | 578 | 46 | MIT | shikijs/textmate-grammars-themes@45e292ef67 samples/css.sample |
shiki/html/html.sample | html | small | 1,596 | 52 | MIT | shikijs/textmate-grammars-themes@45e292ef67 samples/html.sample |
shiki/js/javascript.sample | js | medium | 3,946 | 151 | MIT | shikijs/textmate-grammars-themes@45e292ef67 samples/javascript.sample |
shiki/json/json.sample | json | small | 880 | 38 | MIT | shikijs/textmate-grammars-themes@45e292ef67 samples/json.sample |
shiki/md/markdown.sample | md | medium | 3,725 | 170 | MIT | shikijs/textmate-grammars-themes@45e292ef67 samples/markdown.sample |
shiki/rust/rust.sample | rust | small | 1,011 | 39 | MIT | shikijs/textmate-grammars-themes@45e292ef67 samples/rust.sample |
shiki/svelte/svelte.sample | svelte | small | 714 | 28 | MIT | shikijs/textmate-grammars-themes@45e292ef67 samples/svelte.sample |
shiki/ts/typescript.sample | ts | small | 2,205 | 77 | MIT | shikijs/textmate-grammars-themes@45e292ef67 samples/typescript.sample |
| input | language | tier | bytes | lines | license | upstream, at its pinned commit |
|---|---|---|---|---|---|---|
home/fuz_code/bash/sample_complex.sh | bash | small | 2,749 | 190 | MIT | fuzdev/fuz_code@2e2fafcf97 src/test/fixtures/samples/sample_complex.sh |
home/fuz_code/css/sample_complex.css | css | micro | 502 | 45 | MIT | fuzdev/fuz_code@2e2fafcf97 src/test/fixtures/samples/sample_complex.css |
home/fuz_code/html/sample_complex.html | html | small | 733 | 42 | MIT | fuzdev/fuz_code@2e2fafcf97 src/test/fixtures/samples/sample_complex.html |
home/fuz_code/json/sample_complex.json | json | micro | 327 | 14 | MIT | fuzdev/fuz_code@2e2fafcf97 src/test/fixtures/samples/sample_complex.json |
home/fuz_code/md/sample_complex.md | md | small | 2,799 | 219 | MIT | fuzdev/fuz_code@2e2fafcf97 src/test/fixtures/samples/sample_complex.md |
home/fuz_code/rust/sample_complex.rs | rust | small | 3,012 | 118 | MIT | fuzdev/fuz_code@2e2fafcf97 src/test/fixtures/samples/sample_complex.rs |
home/fuz_code/svelte/sample_complex.svelte | svelte | small | 2,517 | 156 | MIT | fuzdev/fuz_code@2e2fafcf97 src/test/fixtures/samples/sample_complex.svelte |
home/fuz_code/ts/sample_complex.ts | ts | small | 2,883 | 152 | MIT | fuzdev/fuz_code@2e2fafcf97 src/test/fixtures/samples/sample_complex.ts |
| input | language | tier | bytes | lines | license | upstream, at its pinned commit |
|---|---|---|---|---|---|---|
home/twinkleplop/bash/bash.large.sh synthetic | bash | large | 98,856 | 5,045 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/bash.large.sh |
home/twinkleplop/bash/bash.medium.sh synthetic | bash | medium | 10,941 | 557 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/bash.medium.sh |
home/twinkleplop/bash/bash.small.sh synthetic | bash | small | 1,054 | 46 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/bash.small.sh |
home/twinkleplop/bash/deploy.sh | bash | medium | 5,567 | 192 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/deploy.sh |
home/twinkleplop/css/css.large.css synthetic | css | large | 97,622 | 4,814 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/css.large.css |
home/twinkleplop/css/css.medium.css synthetic | css | medium | 10,562 | 670 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/css.medium.css |
home/twinkleplop/css/css.small.css synthetic | css | small | 1,246 | 76 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/css.small.css |
home/twinkleplop/css/site.css synthetic | css | large | 40,864 | 1,901 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/site.css |
home/twinkleplop/html/app.html | html | small | 656 | 18 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/app.html |
home/twinkleplop/html/html.large.html synthetic | html | large | 99,865 | 4,426 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/html.large.html |
home/twinkleplop/html/html.medium.html synthetic | html | medium | 10,262 | 455 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/html.medium.html |
home/twinkleplop/html/html.small.html synthetic | html | small | 1,327 | 52 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/html.small.html |
home/twinkleplop/js/bench-suite.js synthetic | js | medium | 26,389 | 1,062 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/bench-suite.js |
home/twinkleplop/js/javascript.large.js synthetic | js | large | 102,836 | 4,843 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/javascript.large.js |
home/twinkleplop/js/javascript.medium.js synthetic | js | medium | 10,597 | 297 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/javascript.medium.js |
home/twinkleplop/js/javascript.small.js | js | small | 813 | 21 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/javascript.small.js |
home/twinkleplop/json/compiled-grammar.json | json | large | 124,022 | 14,193 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/compiled-grammar.json |
home/twinkleplop/json/json.large.json synthetic | json | large | 99,831 | 4,192 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/json.large.json |
home/twinkleplop/json/json.medium.json synthetic | json | medium | 10,131 | 420 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/json.medium.json |
home/twinkleplop/json/json.small.json synthetic | json | small | 974 | 41 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/json.small.json |
home/twinkleplop/md/architecture.md | md | medium | 25,141 | 341 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/architecture.md |
home/twinkleplop/md/grammar-docs.md synthetic | md | medium | 20,842 | 549 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/grammar-docs.md |
home/twinkleplop/md/markdown.large.md synthetic | md | large | 101,226 | 2,572 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/markdown.large.md |
home/twinkleplop/md/markdown.medium.md synthetic | md | medium | 9,733 | 809 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/markdown.medium.md |
home/twinkleplop/md/markdown.small.md synthetic | md | small | 1,186 | 72 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/markdown.small.md |
home/twinkleplop/rust/pipeline.rs | rust | medium | 8,806 | 326 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/pipeline.rs |
home/twinkleplop/rust/rust.large.rs synthetic | rust | large | 101,709 | 4,830 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/rust.large.rs |
home/twinkleplop/rust/rust.medium.rs synthetic | rust | medium | 12,710 | 602 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/rust.medium.rs |
home/twinkleplop/rust/rust.small.rs synthetic | rust | small | 1,260 | 64 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/rust.small.rs |
home/twinkleplop/svelte/site-codepanel.svelte | svelte | medium | 4,712 | 181 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/site-codepanel.svelte |
home/twinkleplop/svelte/site-inspectorpanel.svelte | svelte | medium | 3,947 | 190 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/site-inspectorpanel.svelte |
home/twinkleplop/svelte/svelte.large.svelte synthetic | svelte | large | 99,669 | 4,641 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/svelte.large.svelte |
home/twinkleplop/svelte/svelte.medium.svelte synthetic | svelte | medium | 10,090 | 436 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/svelte.medium.svelte |
home/twinkleplop/svelte/svelte.small.svelte | svelte | small | 714 | 31 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/svelte.small.svelte |
home/twinkleplop/ts/core-frames.ts synthetic | ts | large | 57,288 | 1,546 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/core-frames.ts |
home/twinkleplop/ts/core-runtime.ts synthetic | ts | large | 70,294 | 1,903 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/core-runtime.ts |
home/twinkleplop/ts/core-types.ts | ts | large | 58,047 | 1,405 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/core-types.ts |
home/twinkleplop/ts/typescript.large.ts synthetic | ts | large | 122,206 | 3,321 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/typescript.large.ts |
home/twinkleplop/ts/typescript.medium.ts synthetic | ts | medium | 7,628 | 393 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/typescript.medium.ts |
home/twinkleplop/ts/typescript.small.ts | ts | small | 799 | 27 | MIT | pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/typescript.small.ts |
| input | language | tier | bytes | lines | license | upstream, at its pinned commit |
|---|---|---|---|---|---|---|
harness/bash/snippet.sh | bash | micro | 435 | 21 | written for this benchmark | |
harness/css/snippet.css | css | micro | 412 | 24 | written for this benchmark | |
harness/html/snippet.html | html | micro | 496 | 21 | written for this benchmark | |
harness/js/snippet.js | js | micro | 465 | 14 | written for this benchmark | |
harness/json/snippet.json | json | micro | 318 | 18 | written for this benchmark | |
harness/md/snippet.md | md | micro | 383 | 21 | written for this benchmark | |
harness/rust/snippet.rs | rust | micro | 572 | 24 | written for this benchmark | |
harness/svelte/snippet.svelte | svelte | micro | 540 | 29 | written for this benchmark | |
harness/ts/snippet.ts | ts | micro | 509 | 19 | written for this benchmark |
| input | language | tier | bytes | lines | license | upstream, at its pinned commit |
|---|---|---|---|---|---|---|
stress/bash/nested.sh | bash | small | 2,233 | 58 | written for this benchmark | |
stress/css/default.min.css synthetic | css | medium | 8,359 | 1 | LicenseRef-W3C-Software-and-Document-2023 | minified by esbuild 0.28.1, from w3c/csswg-drafts@0da42c8afd shared/style/default.css |
stress/css/selectors.css | css | medium | 29,316 | 135 | written for this benchmark | |
stress/html/unclosed.html | html | medium | 20,358 | 80 | written for this benchmark | |
stress/js/client.min.js synthetic | js | medium | 28,413 | 11 | MIT | minified by esbuild 0.28.1, from sveltejs/kit@55ac0d5264 packages/kit/src/runtime/client/client.js |
stress/js/nested_templates.js | js | medium | 14,828 | 86 | written for this benchmark | |
stress/js/unterminated.js | js | medium | 17,013 | 409 | written for this benchmark | |
stress/json/ast.min.json synthetic | json | large | 68,385 | 1 | Apache-2.0 | minified: parsed and serialized again with no whitespace, from microsoft/typescript-go@89d5d5b284 _scripts/ast.json |
stress/json/nested.json | json | medium | 18,559 | 457 | written for this benchmark | |
stress/md/nested.md | md | medium | 7,494 | 114 | written for this benchmark | |
stress/rust/nested.rs | rust | medium | 5,441 | 139 | written for this benchmark | |
stress/svelte/nested_blocks.svelte | svelte | medium | 4,732 | 108 | written for this benchmark | |
stress/ts/long_line.ts | ts | medium | 28,857 | 14 | written for this benchmark | |
stress/ts/nested_blocks.ts | ts | medium | 11,864 | 197 | written for this benchmark |
Licenses #
Every copied file stays under its upstream license, which its provenance records. The corpus readme and the notice beside the neutral inputs give the attribution.