startup_matrix.ts

The cold-start tables: each scenario of a results file as a row, shown as what the library added to the bare Node baseline every sample includes.

view source

Declarations
#

8 declarations

find_startup_bare
#

startup_matrix.ts view source

(results: Pick<MatrixResults, "startup">): { samples: number; median_ms: number; p10_ms: number; p90_ms: number; spread: number; rss_peak_bytes: number; scenario: "set" | ... 3 more ... | "first_highlight"; library: string | null; lang: string | null; set: string | null; bundled: boolean; } | null import {find_startup_bare} from '@ryanatkn/syntax-highlighter-bench/startup_matrix.js';

The bare Node baseline of a results file, or null when it measured no cold start.

results

type Pick<MatrixResults, "startup">

returns

BenchStartup | null

STARTUP_FORMS
#

startup_matrix.ts view source

readonly StartupForm[]

type readonly StartupForm[]

import {STARTUP_FORMS} from '@ryanatkn/syntax-highlighter-bench/startup_matrix.js';

Both forms, in display order.

STARTUP_SCENARIO_LABELS
#

startup_matrix.ts view source

readonly { scenario: "set" | "core" | "lang" | "first_highlight"; label: string; }[] import {STARTUP_SCENARIO_LABELS} from '@ryanatkn/syntax-highlighter-bench/startup_matrix.js';

The scenarios that load a library, in display order, with what each does.

StartupForm
#

startup_matrix.ts view source

StartupForm

type "bundled" | "unbundled"

import type {StartupForm} from '@ryanatkn/syntax-highlighter-bench/startup_matrix.js';

How a library was loaded: as the one bundled chunk, or unbundled from node_modules.

StartupSelection
#

startup_matrix.ts view source

StartupSelection import type {StartupSelection} from '@ryanatkn/syntax-highlighter-bench/startup_matrix.js';

Which cold-start rows to show.

langs

type readonly string[]

forms

type readonly string[]

to_startup_groups
#

startup_matrix.ts view source

(results: MatrixResults, selection: StartupSelection, libraries: readonly string[]): MatrixGroup[] import {to_startup_groups} from '@ryanatkn/syntax-highlighter-bench/startup_matrix.js';

The cold-start scenarios as groups of one form and one scenario. A group of several languages leads with a geometric mean over them. Every number is the scenario's median less the bare baseline's: what the library added to a Node process. In a row holding an addition inside the baseline's own noise, the others are compared with that noise, as lower bounds, and the row is left out of the mean.

results

selection

libraries

the selected library ids, which decide which rows are complete and so enter a mean

type readonly string[]

returns

MatrixGroup[]

the groups, none for a file that measured no cold start

to_startup_noise_ms
#

startup_matrix.ts view source

(bare: Pick<{ samples: number; median_ms: number; p10_ms: number; p90_ms: number; spread: number; rss_peak_bytes: number; scenario: "set" | "bare" | "core" | "lang" | "first_highlight"; library: string | null; lang: string | null; set: string | null; bundled: boolean; }, "p10_ms" | "p90_ms">): number import {to_startup_noise_ms} from '@ryanatkn/syntax-highlighter-bench/startup_matrix.js';

The width of the bare baseline's own p10 to p90 band: how far two samples of a process that loads nothing are apart. A library that added less than this can't be told from one that added nothing.

bare

type Pick<BenchStartup, "p10_ms" | "p90_ms">

returns

number

to_startup_value
#

startup_matrix.ts view source

(entry: { samples: number; median_ms: number; p10_ms: number; p90_ms: number; spread: number; rss_peak_bytes: number; scenario: "set" | "bare" | "core" | "lang" | "first_highlight"; library: string | null; lang: string | null; set: string | null; bundled: boolean; }, bare: { ...; }): MatrixValue import {to_startup_value} from '@ryanatkn/syntax-highlighter-bench/startup_matrix.js';

What a scenario added over the bare baseline, as an entry. An addition smaller than the baseline's own band is unranked: it is printed, has no ratio, and takes no part in a mean. One at or under zero is printed as "≈ bare" and not as a negative time, which no process has.

entry

bare

returns

MatrixValue

Depends on
#

Imported by
#