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:

sourcewhat it holds
neutralreal files from projects no measured library authored, copied unmodified at a pinned commit: the primary set
shikithe sample files Shiki's own benchmark uses, at a pinned commit
homea measured library's own samples, labeled with the library: fuz_code's test fixtures, and the corpus Twinkleplop benchmarks itself on
harnessone short snippet for each language, written for this benchmark by its maintainer, who also maintains fuz_code
stressinputs 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:

tiersize
microunder 600 bytes
small600 bytes to under 3,200
medium3,200 bytes to under 32,000
large32,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 derivation names 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.

neutral — real code no measured library authored
inputlanguagetierbyteslineslicenseupstream, at its pinned commit
neutral/bash/headerscheck bashmedium10,792280PostgreSQL
postgres/postgres@cc053b6e12 src/tools/pginclude/headerscheck
neutral/bash/nvm.sh bashlarge179,6355,416MIT
neutral/bash/postgres-wrapper.sh bashsmall70725PostgreSQL
postgres/postgres@cc053b6e12 contrib/start-scripts/macos/postgres-wrapper.sh
neutral/css/bulma.css csslarge763,92321,564MIT
neutral/css/default.css cssmedium12,501535LicenseRef-W3C-Software-and-Document-2023
w3c/csswg-drafts@0da42c8afd shared/style/default.css
neutral/css/text.css csssmall87548MIT
sveltejs/svelte.dev@a90ebe2304 packages/site-kit/src/lib/styles/text.css
neutral/html/index.html htmlsmall1,52651MIT
prettier/prettier@1dcd0b05d0 website/index.html
neutral/html/Overview.src.html htmllarge107,7122,694LicenseRef-W3C-Software-and-Document-2023
w3c/csswg-drafts@0da42c8afd selectors-3/Overview.src.html
neutral/html/results.template.html htmlmedium18,139741MIT
sveltejs/svelte@7bc0a70fe6 benchmarking/compare/results.template.html
neutral/js/class.js jsmedium9,760371MIT
prettier/prettier@1dcd0b05d0 src/language-js/print/class.js
neutral/js/client.js jslarge91,4073,160MIT
sveltejs/kit@55ac0d5264 packages/kit/src/runtime/client/client.js
neutral/js/parse.js jssmall96341MIT
neutral/json/ast.json jsonlarge175,0375,502Apache-2.0
neutral/json/kit.tsconfig.json jsonsmall1,04829MIT
sveltejs/kit@55ac0d5264 packages/kit/tsconfig.json
neutral/json/typesMap.json jsonmedium17,285497Apache-2.0
microsoft/TypeScript@637d5746b7 src/server/typesMap.json
neutral/md/02-state.md mdmedium10,036352MIT
sveltejs/svelte@7bc0a70fe6 documentation/docs/02-runes/02-$state.md
neutral/md/Explainer.md mdlarge169,1153,504Apache-2.0
neutral/md/postgres.README.md mdsmall98921PostgreSQL
neutral/rust/dent.rs rustmedium11,211352Unlicense OR MIT
neutral/rust/raw_query.rs rustsmall85237MIT
tokio-rs/axum@c59208c86f axum/src/extract/raw_query.rs
neutral/rust/table.rs rustlarge100,9603,197MIT OR Apache-2.0
neutral/svelte/Breadcrumb.svelte sveltesmall1,14144MIT
techniq/svelte-ux@11c79b8c6e packages/svelte-ux/src/lib/components/Breadcrumb.svelte
neutral/svelte/harvest.svelte syntheticsveltelarge106,7233,186MIT
techniq/layerchart@ec05fb1b84 packages/layerchart/src/lib/components/Legend.svelte
techniq/layerchart@ec05fb1b84 packages/layerchart/src/lib/components/layers/Canvas.svelte
techniq/svelte-ux@11c79b8c6e packages/svelte-ux/src/lib/components/Button.svelte
techniq/svelte-ux@11c79b8c6e packages/svelte-ux/src/lib/components/TextField.svelte
themesberg/flowbite-svelte@85f20a048e src/lib/datepicker/Datepicker.svelte
themesberg/flowbite-svelte@85f20a048e src/lib/clipboard-manager/ClipboardManager.svelte
neutral/svelte/Layer.svelte sveltemedium9,455343MIT
neutral/ts/core.ts tslarge92,4192,595Apache-2.0
microsoft/TypeScript@637d5746b7 src/compiler/core.ts
neutral/ts/options.ts tsmedium10,080251MIT
sveltejs/language-tools@bf2993e192 packages/svelte-check/src/options.ts
neutral/ts/transform.ts tssmall1,16027Apache-2.0
microsoft/TypeScript@637d5746b7 src/services/transform.ts
shiki — Shiki's own benchmark samples
inputlanguagetierbyteslineslicenseupstream, at its pinned commit
shiki/bash/shellscript.sample bashsmall66128MIT
shiki/css/css.sample cssmicro57846MIT
shiki/html/html.sample htmlsmall1,59652MIT
shiki/js/javascript.sample jsmedium3,946151MIT
shiki/json/json.sample jsonsmall88038MIT
shiki/md/markdown.sample mdmedium3,725170MIT
shiki/rust/rust.sample rustsmall1,01139MIT
shiki/svelte/svelte.sample sveltesmall71428MIT
shiki/ts/typescript.sample tssmall2,20577MIT
home: fuz_code — home turf: fuz_code's own samples
inputlanguagetierbyteslineslicenseupstream, at its pinned commit
home/fuz_code/bash/sample_complex.sh bashsmall2,749190MIT
fuzdev/fuz_code@2e2fafcf97 src/test/fixtures/samples/sample_complex.sh
home/fuz_code/css/sample_complex.css cssmicro50245MIT
fuzdev/fuz_code@2e2fafcf97 src/test/fixtures/samples/sample_complex.css
home/fuz_code/html/sample_complex.html htmlsmall73342MIT
fuzdev/fuz_code@2e2fafcf97 src/test/fixtures/samples/sample_complex.html
home/fuz_code/json/sample_complex.json jsonmicro32714MIT
fuzdev/fuz_code@2e2fafcf97 src/test/fixtures/samples/sample_complex.json
home/fuz_code/md/sample_complex.md mdsmall2,799219MIT
fuzdev/fuz_code@2e2fafcf97 src/test/fixtures/samples/sample_complex.md
home/fuz_code/rust/sample_complex.rs rustsmall3,012118MIT
fuzdev/fuz_code@2e2fafcf97 src/test/fixtures/samples/sample_complex.rs
home/fuz_code/svelte/sample_complex.svelte sveltesmall2,517156MIT
fuzdev/fuz_code@2e2fafcf97 src/test/fixtures/samples/sample_complex.svelte
home/fuz_code/ts/sample_complex.ts tssmall2,883152MIT
fuzdev/fuz_code@2e2fafcf97 src/test/fixtures/samples/sample_complex.ts
home: twinkleplop — home turf: twinkleplop's own samples
inputlanguagetierbyteslineslicenseupstream, at its pinned commit
home/twinkleplop/bash/bash.large.sh syntheticbashlarge98,8565,045MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/bash.large.sh
home/twinkleplop/bash/bash.medium.sh syntheticbashmedium10,941557MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/bash.medium.sh
home/twinkleplop/bash/bash.small.sh syntheticbashsmall1,05446MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/bash.small.sh
home/twinkleplop/bash/deploy.sh bashmedium5,567192MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/deploy.sh
home/twinkleplop/css/css.large.css syntheticcsslarge97,6224,814MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/css.large.css
home/twinkleplop/css/css.medium.css syntheticcssmedium10,562670MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/css.medium.css
home/twinkleplop/css/css.small.css syntheticcsssmall1,24676MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/css.small.css
home/twinkleplop/css/site.css syntheticcsslarge40,8641,901MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/site.css
home/twinkleplop/html/app.html htmlsmall65618MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/app.html
home/twinkleplop/html/html.large.html synthetichtmllarge99,8654,426MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/html.large.html
home/twinkleplop/html/html.medium.html synthetichtmlmedium10,262455MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/html.medium.html
home/twinkleplop/html/html.small.html synthetichtmlsmall1,32752MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/html.small.html
home/twinkleplop/js/bench-suite.js syntheticjsmedium26,3891,062MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/bench-suite.js
home/twinkleplop/js/javascript.large.js syntheticjslarge102,8364,843MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/javascript.large.js
home/twinkleplop/js/javascript.medium.js syntheticjsmedium10,597297MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/javascript.medium.js
home/twinkleplop/js/javascript.small.js jssmall81321MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/javascript.small.js
home/twinkleplop/json/compiled-grammar.json jsonlarge124,02214,193MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/compiled-grammar.json
home/twinkleplop/json/json.large.json syntheticjsonlarge99,8314,192MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/json.large.json
home/twinkleplop/json/json.medium.json syntheticjsonmedium10,131420MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/json.medium.json
home/twinkleplop/json/json.small.json syntheticjsonsmall97441MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/json.small.json
home/twinkleplop/md/architecture.md mdmedium25,141341MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/architecture.md
home/twinkleplop/md/grammar-docs.md syntheticmdmedium20,842549MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/grammar-docs.md
home/twinkleplop/md/markdown.large.md syntheticmdlarge101,2262,572MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/markdown.large.md
home/twinkleplop/md/markdown.medium.md syntheticmdmedium9,733809MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/markdown.medium.md
home/twinkleplop/md/markdown.small.md syntheticmdsmall1,18672MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/markdown.small.md
home/twinkleplop/rust/pipeline.rs rustmedium8,806326MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/pipeline.rs
home/twinkleplop/rust/rust.large.rs syntheticrustlarge101,7094,830MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/rust.large.rs
home/twinkleplop/rust/rust.medium.rs syntheticrustmedium12,710602MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/rust.medium.rs
home/twinkleplop/rust/rust.small.rs syntheticrustsmall1,26064MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/rust.small.rs
home/twinkleplop/svelte/site-codepanel.svelte sveltemedium4,712181MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/site-codepanel.svelte
home/twinkleplop/svelte/site-inspectorpanel.svelte sveltemedium3,947190MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/site-inspectorpanel.svelte
home/twinkleplop/svelte/svelte.large.svelte syntheticsveltelarge99,6694,641MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/svelte.large.svelte
home/twinkleplop/svelte/svelte.medium.svelte syntheticsveltemedium10,090436MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/svelte.medium.svelte
home/twinkleplop/svelte/svelte.small.svelte sveltesmall71431MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/svelte.small.svelte
home/twinkleplop/ts/core-frames.ts synthetictslarge57,2881,546MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/core-frames.ts
home/twinkleplop/ts/core-runtime.ts synthetictslarge70,2941,903MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/core-runtime.ts
home/twinkleplop/ts/core-types.ts tslarge58,0471,405MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/real/core-types.ts
home/twinkleplop/ts/typescript.large.ts synthetictslarge122,2063,321MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/typescript.large.ts
home/twinkleplop/ts/typescript.medium.ts synthetictsmedium7,628393MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/typescript.medium.ts
home/twinkleplop/ts/typescript.small.ts tssmall79927MIT
pngwn/twinkleplop@f5418aaabf lib/bench/perf/corpus/sized/typescript.small.ts
harness — snippets written for this benchmark by its maintainer, who also maintains fuz_code
inputlanguagetierbyteslineslicenseupstream, at its pinned commit
harness/bash/snippet.sh bashmicro43521 written for this benchmark
harness/css/snippet.css cssmicro41224 written for this benchmark
harness/html/snippet.html htmlmicro49621 written for this benchmark
harness/js/snippet.js jsmicro46514 written for this benchmark
harness/json/snippet.json jsonmicro31818 written for this benchmark
harness/md/snippet.md mdmicro38321 written for this benchmark
harness/rust/snippet.rs rustmicro57224 written for this benchmark
harness/svelte/snippet.svelte sveltemicro54029 written for this benchmark
harness/ts/snippet.ts tsmicro50919 written for this benchmark
stress — pathological and minified inputs, generated for this benchmark by its maintainer, who also maintains fuz_code, to find worst cases; Shiki is timed with its per-line limit out of reach, so it highlights lines its default would cut off
inputlanguagetierbyteslineslicenseupstream, at its pinned commit
stress/bash/nested.sh bashsmall2,23358 written for this benchmark
stress/css/default.min.css syntheticcssmedium8,3591LicenseRef-W3C-Software-and-Document-2023
minified by esbuild 0.28.1, from
w3c/csswg-drafts@0da42c8afd shared/style/default.css
stress/css/selectors.css cssmedium29,316135 written for this benchmark
stress/html/unclosed.html htmlmedium20,35880 written for this benchmark
stress/js/client.min.js syntheticjsmedium28,41311MIT
minified by esbuild 0.28.1, from
sveltejs/kit@55ac0d5264 packages/kit/src/runtime/client/client.js
stress/js/nested_templates.js jsmedium14,82886 written for this benchmark
stress/js/unterminated.js jsmedium17,013409 written for this benchmark
stress/json/ast.min.json syntheticjsonlarge68,3851Apache-2.0
minified: parsed and serialized again with no whitespace, from
stress/json/nested.json jsonmedium18,559457 written for this benchmark
stress/md/nested.md mdmedium7,494114 written for this benchmark
stress/rust/nested.rs rustmedium5,441139 written for this benchmark
stress/svelte/nested_blocks.svelte sveltemedium4,732108 written for this benchmark
stress/ts/long_line.ts tsmedium28,85714 written for this benchmark
stress/ts/nested_blocks.ts tsmedium11,864197 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.