readonly BundleCompression[] type readonly BundleCompression[]
import {BUNDLE_COMPRESSIONS} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; Every compression, in display order.
The bundle-size tables. A results file measures each library over feature sets: one with no language, one for each language alone, and a few of several languages. What a language adds to a library is derived here, as its single-language set less the set with none, and is never stored, so it can't drift from the measured sets.
The sets are found by what they hold, not by their ids: the core set is the one with no language, and a language's own set is the one holding it alone.
22 declarations
readonly BundleCompression[] type readonly BundleCompression[]
import {BUNDLE_COMPRESSIONS} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; Every compression, in display order.
readonly { id: BundleView; label: string; }[] import {BUNDLE_VIEWS} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; Both views, with their labels, in display order.
BundleCompression type "raw" | "gzip" | "brotli"
import type {BundleCompression} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; Which size of a bundle to show: the minified bytes, or those bytes compressed.
BundleSelection import type {BundleSelection} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; What the bundle tables show.
langstype readonly string[]
setThe id of the set of several languages to sum and to read wasm and CSS from.
type string
compressiontype BundleCompression
BundleView type "incremental" | "totals"
import type {BundleView} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; Which bundle table to show: what each language costs, or each set's total.
CombinedSet import type {CombinedSet} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; Sets of several languages that hold the same ones, shown as one row.
idsThe ids of the sets that hold these languages, the first being the one measured.
type string[]
labeltype string
langstype string[]
footnotetype string | null
(sets: readonly { id: string; label: string; langs: string[]; footnote: string | null; }[]): { id: string; label: string; langs: string[]; footnote: string | null; } | null import {find_core_set} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; The set with no language: a library's runtime floor.
setsreadonly BenchSet[]BenchSet | null
(sets: readonly { id: string; label: string; langs: string[]; footnote: string | null; }[], lang: string): { id: string; label: string; langs: string[]; footnote: string | null; } | null import {find_single_set} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; The set holding one language alone.
setsreadonly BenchSet[]langstringBenchSet | null
(sets: readonly { id: string; label: string; langs: string[]; footnote: string | null; }[], langs: readonly { id: string; label: string; timed: boolean; }[]): { id: string; label: string; langs: string[]; footnote: string | null; } | null import {find_timed_set} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; The set of every timed language, which every library claims.
setsreadonly BenchSet[]langsreadonly BenchLang[]BenchSet | null
(sets: readonly { id: string; label: string; langs: string[]; footnote: string | null; }[], langs: readonly { id: string; label: string; timed: boolean; }[], lang: string): { id: string; label: string; langs: string[]; footnote: string | null; } | null import {find_without_set} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; The set of every timed language but one.
setsreadonly BenchSet[]langsreadonly BenchLang[]langstringBenchSet | null
readonly { id: "bytes" | "packages" | "files"; label: string; unit: MatrixUnit; }[] import {INSTALL_MEASURES} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; The numbers of an install footprint, with their labels and units, in display order.
(results: MatrixResults, selection: Pick<BundleSelection, "set" | "compression">): MatrixGroup import {to_bundle_beside_group} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; What a page loads beside the JS, kept out of the figures above it: the wasm binary, the theme stylesheet, and which color schemes that theme covers, since a theme with two is larger than a theme with one.
resultsselectionPick<BundleSelection, "set" | "compression">MatrixGroup (results: MatrixResults, selection: BundleSelection): MatrixGroup[] import {to_bundle_cost_groups} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; The incremental-cost view: the core set, what each selected language adds to it, and for the selected set the sum of its languages beside its measured total.
resultsselectionthe groups, none for a file that measured no bundle
(results: Pick<MatrixResults, "sets" | "bundle">, library: string, lang: string, compression: BundleCompression): MatrixEntry import {to_bundle_increment_entry} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; What one language adds to one library: its single-language set less the core set. Unsupported when the library doesn't claim the language.
resultsPick<MatrixResults, "sets" | "bundle">librarystringlangstringcompression(results: Pick<MatrixResults, "bundle">, library: string, set: { id: string; label: string; langs: string[]; footnote: string | null; } | null, compression: BundleCompression): MatrixEntry import {to_bundle_loaded_entry} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; Everything a page loads for one library over one set: the JS, the wasm binary, and the theme stylesheet, each compressed on its own and added up. A library with no binary or no stylesheet adds nothing for it, so a library whose engine ships as wasm is compared on all it ships.
resultsPick<MatrixResults, "bundle">librarystringsetBenchSet | nullcompression(results: Pick<MatrixResults, "langs" | "sets" | "bundle">, library: string, lang: string): MatrixEntry import {to_bundle_marginal_entry} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; What one timed language adds to a bundle of all the others: the set of every timed language less the set without it, in minified bytes. Unlike to_bundle_increment_entry, this never carries runtime that any language needs, which the first language loaded pays for. It is never compressed: compression works across a whole bundle, so the difference of two compressed bundles doesn't isolate one language's share, and can come out negative. A language the others already hold adds nothing. Unmeasured when the file holds neither set.
resultsPick<MatrixResults, "langs" | "sets" | "bundle">librarystringlangstring(results: Pick<MatrixResults, "bundle">, library: string, set: { id: string; label: string; langs: string[]; footnote: string | null; } | null, compression: BundleCompression): MatrixEntry import {to_bundle_size_entry} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; The JS size of one library over one set.
resultsPick<MatrixResults, "bundle">librarystringsetBenchSet | nullcompression(results: Pick<MatrixResults, "sets" | "bundle">, library: string, langs: readonly string[], compression: BundleCompression): MatrixEntry import {to_bundle_sum_entry} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; The core set plus what each language of a set adds, for one library. It equals the set's measured size only when the languages share no code, so the two are shown side by side. Unsupported, naming the languages, when the library lacks any of them.
resultsPick<MatrixResults, "sets" | "bundle">librarystringlangsreadonly string[]compression(results: MatrixResults, selection: Pick<BundleSelection, "set" | "compression">): MatrixGroup[] import {to_bundle_total_groups} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; The set totals: the core set and every set of several languages, each as it was measured, then the same sets with everything a page loads added up.
resultsselectionPick<BundleSelection, "set" | "compression">the groups, none for a file that measured no bundle
(set: CombinedSet): string import {to_combined_set_note} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; A combined set's languages, its footnote, and that it stands for several sets, when it does.
setstring (sets: readonly { id: string; label: string; langs: string[]; footnote: string | null; }[], langs: readonly { id: string; label: string; timed: boolean; }[]): CombinedSet[] import {to_combined_sets} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; The sets of several languages, with sets that hold the same languages merged into one entry that names them all. Two such sets measure the same bundle, so showing both would be a duplicate row that says nothing. The sets of every timed language but one are left out: they are there for what each language adds (to_bundle_marginal_entry), not to be shown.
setsreadonly BenchSet[]langsreadonly BenchLang[](results: MatrixResults): MatrixGroup | null import {to_install_group} from '@ryanatkn/syntax-highlighter-bench/bundle_matrix.js'; The install footprints: what npm install of each library adds, as a row for
each number. The footprint is everything the packages ship, every language,
theme, and type declaration included, and not what a page loads, which the
bundle tables show.
resultsMatrixGroup | null
the group, or null for a file that measured no footprint