api #

benchmark suite and results site for JS syntax highlighters

33 modules ยท 236 declarations

Modules
#

BarChart
#

BarChart.svelte view source

import BarChart from '@ryanatkn/syntax-highlighter-bench/BarChart.svelte';

libraries

The libraries shown, in bar order.

type readonly BenchLibrary[]

row

title

What the chart measures, as a heading.

type string

note?

Under the bars, after which direction is better: the unit and what was measured.

type string | null
optional default null

details?

Whether each bar shows its number's details beneath it.

type boolean
optional default false

BarChartItem
#

bar_chart.ts view source

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

One library's bar: a number with its length and ratio, or the reason there is none.

library

type string

text

The number as text, or the reason there is none.

type string

has_value

Whether the library has a number in the row.

type boolean

fraction

The bar's length, as a fraction of the row's largest number: 0, and no bar, with no number or one at or under zero.

type number

ratio

The ratio against the baseline, when the number has one.

type number | undefined

within_floor

Whether the ratio is inside the row's noise floor, and so not a difference.

type boolean

bound

Whether the ratio is a lower bound, as matrix_row_is_bounded says.

type boolean

anchor

Whether this library's number is the one the ratios are taken against.

type boolean

details

What the number is made of, as the tables show it in a cell's details.

type string[]

BENCH_ANCHOR_STABLE_BELOW
#

results_schema.ts view source

0.03 import {BENCH_ANCHOR_STABLE_BELOW} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

The anchor drift under which a run counts as stable; 0.03 is 3%. Past it the machine changed state during the run, and the ratios between libraries in a cell are more trustworthy than any absolute time.

bench_heap_agrees
#

results_schema.ts view source

(a: { retained_kb: number; code_kb: number; external_kb: number; }, b: { retained_kb: number; code_kb: number; external_kb: number; }): boolean import {bench_heap_agrees} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

Whether two heap entries are the same reading, each number within heap_readings_agree.

a

b

returns

boolean

bench_heaps_agree
#

results_schema.ts view source

(a: Record<string, Record<string, { retained_kb: number; code_kb: number; external_kb: number; }>>, b: Record<string, Record<string, { retained_kb: number; code_kb: number; external_kb: number; }>>): boolean import {bench_heaps_agree} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

Whether two heap sections hold the same readings, each within heap_readings_agree.

a

type Record<string, Record<string, BenchHeap>>

b

type Record<string, Record<string, BenchHeap>>

returns

boolean

BENCH_MODES
#

bench_constants.ts view source

readonly ["tokenize", "html"] import {BENCH_MODES} from '@ryanatkn/syntax-highlighter-bench/bench_constants.js';

The stages a cell runs, in display order.

bench_results_are_timed
#

site_results.ts view source

(results: { meta: { generated_at: string | null; machine: { name: string; cpu: string; threads: number | null; governor: string | null; cpufreq_driver: string | null; epp: string | null; boost: boolean | null; memory_gb: number; os_release: string; } | null; ... 10 more ...; bundler: { ...; } | ... 1 more ... | null; }; ... 8 more ...; coverage: Record<...>; }): boolean import {bench_results_are_timed} from '@ryanatkn/syntax-highlighter-bench/site_results.js';

Whether a results file holds any timed number.

results

returns

boolean

bench_results_find_gaps
#

results_schema.ts view source

(results: BenchResultsCoverage, numbers?: "values" | "deterministic"): BenchResultsGap[] import {bench_results_find_gaps} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

Lists what a results file lacks to be a complete run, from the file alone:

  • in every cell, every library of the roster that claims the cell's language has a number or an entry in meta.excluded. The number is a timed value, or for a deterministic-only file the one the cell states: its token count on a tokenize cell, its output size on an html cell
  • every listed input of a timed language that some library claims has a cell in every mode the file's cells use

It can't tell that an input is missing altogether, or a whole mode: the inputs roster lists what was measured, only meta.corpus_hash names the corpus it came from, and the modes are taken from the cells so that a file stays valid when the harness gains a mode.

results

the file, or the parts of it that say

numbers

which numbers the file should be complete in: its timed values, or the deterministic number each cell states

type "values" | "deterministic"
default 'values'

returns

BenchResultsGap[]

the gaps, none for a file that covers everything it lists

bench_results_find_startup_gaps
#

results_schema.ts view source

(results: BenchResultsStartupCoverage): BenchResultsGap[] import {bench_results_find_startup_gaps} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

Lists the cold-start scenarios a results file lacks to be a complete run, from the file alone. Each of these has an entry in startup or in meta.startup_excluded:

  • the bare baseline
  • for every library of the roster, unbundled and bundled: core, then lang and first_highlight for every timed language it claims, then set for every feature set the file's cold start names, where the library claims every language of it

A scenario over a language or a set the library doesn't claim is unsupported, and is no gap. The sets are taken from the file, since the schema doesn't say which sets a harness starts cold. So one thing the file can't show: with every set entry removed it names no set, and still reads as complete.

results

the file, or the parts of it that say

returns

BenchResultsGap[]

the gaps, none for a file whose cold start is whole

bench_results_is_publishable
#

results_schema.ts view source

(results: { meta: { generated_at: string | null; machine: { name: string; cpu: string; threads: number | null; governor: string | null; cpufreq_driver: string | null; epp: string | null; boost: boolean | null; memory_gb: number; os_release: string; } | null; ... 10 more ...; bundler: { ...; } | ... 1 more ... | null; }; ... 8 more ...; coverage: Record<...>; }): boolean import {bench_results_is_publishable} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

Whether a run's numbers can be published as results: a complete full run with no gap in its cells or its cold start (bench_results_find_gaps, bench_results_find_startup_gaps), from a commit that records everything that ran, on a machine that held still and was calibrated, so the run carries a noise floor that says which differences are results. A run that was stopped and resumed qualifies like any other: its anchor covers every segment. A site shows anything else as what it is, never as a result.

results

returns

boolean

bench_run_is_complete
#

results_schema.ts view source

(run: Pick<{ kind: "full" | "smoke" | "calibrate"; passes: number; rounds: number; target_ms: number; warmup_ms: number; rewarm_ms: number; retries: number; loaded_langs: "cell"; collection: "minor"; ... 6 more ...; load_at_start: number; }, "kind" | "filters">): boolean import {bench_run_is_complete} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

Whether a run set out to cover everything: every library on every cell, and for a full run in every cold-start scenario, measured for real. A smoke run never did, and neither did a run with any filter. Whether the file then holds everything is bench_results_find_gaps and bench_results_find_startup_gaps.

run

type Pick<BenchRun, "kind" | "filters">

returns

boolean

BENCH_SIZES
#

bench_constants.ts view source

readonly ["micro", "small", "medium", "large"] import {BENCH_SIZES} from '@ryanatkn/syntax-highlighter-bench/bench_constants.js';

The size tiers of an input, smallest first.

BENCH_SOURCES
#

bench_constants.ts view source

readonly ["neutral", "shiki", "home", "harness", "stress"] import {BENCH_SOURCES} from '@ryanatkn/syntax-highlighter-bench/bench_constants.js';

Where an input came from, the primary set first and the stress inputs last.

BENCH_WRITTEN_SOURCES
#

bench_constants.ts view source

readonly ["harness", "stress"] import {BENCH_WRITTEN_SOURCES} from '@ryanatkn/syntax-highlighter-bench/bench_constants.js';

The sources whose inputs may be written for this benchmark, with no upstream file.

BenchAnchor
#

results_schema.ts view source

value + type

{ drift: number; stable: boolean; } import {BenchAnchor} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

The reference workload measured at the start and end of a run, and of every segment of a run that was stopped and resumed. Its drift says whether the machine changed state while the run was in progress.

drift

type number

stable

type boolean

BenchBundleEntry
#

results_schema.ts view source

value + type

{ wasm: { raw: number; gzip: number; brotli: number; } | null; css: { raw: number; gzip: number; brotli: number; } | null; raw: number; gzip: number; brotli: number; } | { unsupported: string[]; }

type BenchBundleSizes | BenchBundleUnsupported

import {BenchBundleEntry} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

One library's result for one feature set: its sizes, or why there are none. An entry with an unsupported key is read as the latter and anything else as sizes, so a malformed entry is reported against the shape it was meant to be.

BenchBundler
#

results_schema.ts view source

value + type

{ esbuild: string; gzip_level: number; brotli_quality: number; vite: string; rolldown: string; } | { esbuild: string; gzip_level: number; brotli_quality: number; vite: string; rollup: string; }

type BenchBundlerRolldown | BenchBundlerRollup

import {BenchBundler} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

What the bundle sizes were built and compressed with. Together with the libraries' versions it is what the sizes depend on, apart from the zlib and brotli inside the Node that compressed them. The compression levels are also the ones the HTML's compressed sizes (BenchCell.compressed) are taken at. It names exactly one of rolldown and rollup, and is reported against the shape it names, so a malformed one never reads as a bare "Invalid input".

BenchBundlerRolldown
#

results_schema.ts view source

value + type

{ esbuild: string; gzip_level: number; brotli_quality: number; vite: string; rolldown: string; } import {BenchBundlerRolldown} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

What bundles from Vite 8 on: Vite with the Rolldown inside it.

esbuild

type string

gzip_level

type number

brotli_quality

type number

vite

type string

rolldown

type string

BenchBundlerRollup
#

results_schema.ts view source

value + type

{ esbuild: string; gzip_level: number; brotli_quality: number; vite: string; rollup: string; } import {BenchBundlerRollup} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

What bundled up to Vite 7, which files measured then record: Vite with the Rollup inside it.

esbuild

type string

gzip_level

type number

brotli_quality

type number

vite

type string

rollup

type string

BenchBundleSizes
#

results_schema.ts view source

value + type

{ wasm: { raw: number; gzip: number; brotli: number; } | null; css: { raw: number; gzip: number; brotli: number; } | null; raw: number; gzip: number; brotli: number; } import {BenchBundleSizes} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

The bundled size of one library over one feature set: raw, gzip, and brotli are the minified JS, and what else a page loads for the library has a section of its own. Deterministic.

wasm

type BenchByteSizes | null

css

type BenchByteSizes | null

raw

type number

gzip

type number

brotli

type number

BenchBundleUnsupported
#

results_schema.ts view source

value + type

{ unsupported: string[]; } import {BenchBundleUnsupported} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

A feature set a library can't be measured over, naming the languages it lacks.

unsupported

type string[]

BenchByteSizes
#

results_schema.ts view source

value + type

{ raw: number; gzip: number; brotli: number; } import {BenchByteSizes} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

Some bytes a page loads, measured raw and compressed. Deterministic.

raw

type number

gzip

type number

brotli

type number

BenchCell
#

results_schema.ts view source

value + type

{ id: string; metric: "throughput"; lang: string; size: "micro" | "small" | "medium" | "large"; mode: "tokenize" | "html"; source: "neutral" | "shiki" | "home" | "harness" | "stress"; ... 8 more ...; compressed: Record<...>; } import {BenchCell} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

One input measured in one mode, across libraries. A library absent from values, tokens, and output was not measured here: it is unsupported, excluded, or outside the run's filters.

Each deterministic number is stated once for an input, on the cell whose call returns it: tokens on the tokenize cell, since it counts what tokenize returned, and output on the html cell. The other is empty there.

id

type string

metric

type "throughput"

lang

type string

size

type "micro" | "small" | "medium" | "large"

mode

type "tokenize" | "html"

source

type "neutral" | "shiki" | "home" | "harness" | "stress"

home

type string | null

file

type string

bytes

type number

lines

type number

synthetic

type boolean

values

type Record<string, BenchCellValue>

tokens

type Record<string, number>

output

type Record<string, BenchCellOutput>

compressed

type Record<string, BenchCellCompressed>

BenchCellCompressed
#

results_schema.ts view source

value + type

{ gzip: number; brotli: number; } import {BenchCellCompressed} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

The size of one library's HTML for a cell's input once compressed, at the levels BenchBundler records: what a server sends for a page that renders the highlighted input. Its raw size is BenchCellOutput.html_bytes. Deterministic.

gzip

type number

brotli

type number

BenchCellOutput
#

results_schema.ts view source

value + type

{ html_bytes: number; spans: number; } import {BenchCellOutput} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

The size of one library's HTML for a cell's input. Deterministic.

html_bytes

type number

spans

type number

BenchCellValue
#

results_schema.ts view source

value + type

{ ns_per_op: number; ops_per_sec: number; mb_per_sec: number; p10_ns: number; p90_ns: number; spread: number; pass_medians_ns: number[]; iterations: number; rss_peak_bytes: number; attempts: number; } import {BenchCellValue} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

One library's timing and memory in one cell. Machine-dependent.

ns_per_op

type number

ops_per_sec

type number

mb_per_sec

type number

p10_ns

type number

p90_ns

type number

spread

type number

pass_medians_ns

type number[]

iterations

type number

rss_peak_bytes

type number

attempts

type number

BenchColorScheme
#

results_schema.ts view source

value + type

"light" | "dark"

type "light" | "dark"

import {BenchColorScheme} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

A color scheme a theme covers.

BenchCoverageEntry
#

results_schema.ts view source

value + type

true | { via: string; }

type true | { via: string; }

import {BenchCoverageEntry} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

How a library supports a language it claims: true for directly, or a footnote for anything a reader should know, like a third-party grammar.

BenchEngineKind
#

results_schema.ts view source

value + type

"scanner" | "grammar_vm" | "regex" | "textmate"

type "scanner" | "grammar_vm" | "regex" | "textmate"

import {BenchEngineKind} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

How a library lexes. A filterable tag, not a ranking.

BenchExcluded
#

results_schema.ts view source

value + type

{ cell: string; library: string; reason: string; } import {BenchExcluded} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

A library that claims a cell's language but failed the pre-measurement output check there, so it was not measured. Distinct from unsupported, which is a language missing from the library's coverage.

cell

type string

library

type string

reason

type string

BenchHeap
#

results_schema.ts view source

value + type

{ retained_kb: number; code_kb: number; external_kb: number; } import {BenchHeap} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

What a library holds once one language is loaded and highlighted once, over a bare Node process: its single:<lang> bundle imported, the language's harness snippet highlighted, and garbage collected until the heap settles. That is after one highlight of a small snippet; larger inputs leave more, most of all for regexp and wasm engines. Deterministic for a Node version and platform (the one the check workflow pins, on x64), within heap_readings_agree.

retained_kb

type number

code_kb

type number

external_kb

type number

BenchInput
#

results_schema.ts view source

value + type

{ file: string; source: "neutral" | "shiki" | "home" | "harness" | "stress"; home: string | null; lang: string; size: "micro" | "small" | "medium" | "large"; bytes: number; lines: number; sha256: string; synthetic: boolean; provenance: { ...; }[]; derivation: string | null; } import {BenchInput} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

One input of the corpus: a file, what it is, and where it came from. The corpus manifest is a list of these, and a results file carries the ones its cells measured.

file

type string

source

type "neutral" | "shiki" | "home" | "harness" | "stress"

home

type string | null

lang

type string

size

type "micro" | "small" | "medium" | "large"

bytes

type number

lines

type number

sha256

type string

synthetic

type boolean

provenance

type BenchProvenance[]

derivation

type string | null

BenchInstall
#

results_schema.ts view source

value + type

{ packages: number; files: number; bytes: number; closure: string; } import {BenchInstall} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

What npm install of a library adds: the runtime dependency closure of its package and its extra packages, each package counted once, as this repository's lockfile installs them. Deterministic.

packages

type number

files

type number

bytes

type number

closure

type string

BenchLang
#

results_schema.ts view source

value + type

{ id: string; label: string; timed: boolean; } import {BenchLang} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

One language id of the run, as the harness declares it in bench/langs.ts.

id

type string

label

type string

timed

type boolean

BenchLibrary
#

results_schema.ts view source

value + type

{ id: string; label: string; package: string; version: string; output: "classes" | "inline_styles"; engine: "scanner" | "grammar_vm" | "regex" | "textmate"; by_maintainer: boolean; note: string | null; theme_schemes: ("light" | "dark")[]; extra_packages?: Record<...> | undefined; } import {BenchLibrary} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

One measured library. The roster of these drives every page of the site.

id

type string

label

type string

package

type string

version

type string

output

type "classes" | "inline_styles"

engine

type "scanner" | "grammar_vm" | "regex" | "textmate"

by_maintainer

type boolean

note

type string | null

theme_schemes

type ("light" | "dark")[]

extra_packages?

type Record<string, string>

BenchMachine
#

results_schema.ts view source

value + type

{ name: string; cpu: string; threads: number | null; governor: string | null; cpufreq_driver: string | null; epp: string | null; boost: boolean | null; memory_gb: number; os_release: string; } import {BenchMachine} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

The machine a run's timed numbers came from.

name

type string

cpu

type string

threads

type number | null

governor

type string | null

cpufreq_driver

type string | null

epp

type string | null

boost

type boolean | null

memory_gb

type number

os_release

type string

BenchMeta
#

results_schema.ts view source

value + type

{ generated_at: string | null; machine: { name: string; cpu: string; threads: number | null; governor: string | null; cpufreq_driver: string | null; epp: string | null; boost: boolean | null; memory_gb: number; os_release: string; } | null; ... 10 more ...; bundler: { ...; } | ... 1 more ... | null; } import {BenchMeta} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

Where, when, and from what a run was produced. generated_at, machine, node, and commit say where timed numbers came from, and are null only in a file that has none: its numbers are the same on any machine, at any time, and a commit can't name the tree it is itself committed in.

generated_at

type string | null

machine

type BenchMachine | null

node

type string | null

commit

type string | null

corpus_hash

type string

run

type BenchRun | null

anchor

type BenchAnchor | null

libraries

type BenchLibrary[]

excluded

type BenchExcluded[]

startup_excluded

type BenchStartupExcluded[]

noise_floor

type BenchNoiseFloor | null

process_noise

type BenchProcessNoise | null

bundler

type BenchBundlerRolldown | BenchBundlerRollup | null

BenchMetric
#

results_schema.ts view source

value + type

"throughput" import {BenchMetric} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

What a cell measures.

BenchMode
#

results_schema.ts view source

value + type

"tokenize" | "html"

type "tokenize" | "html"

import {BenchMode} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

The stage a cell runs: tokens out, or the HTML string consumers ship.

BenchNoiseFloor
#

results_schema.ts view source

value + type

{ per_cell: number; geomean: number; per_process: number | null; } import {BenchNoiseFloor} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

The machine's noise floor, from a calibration run: every library is measured as two, in separate processes, which should come out equal. A difference smaller than this is not a result.

per_cell

type number

geomean

type number

per_process

type number | null

BenchOutputKind
#

results_schema.ts view source

value + type

"classes" | "inline_styles"

type "classes" | "inline_styles"

import {BenchOutputKind} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

What a library's html output carries its colors in.

BenchProcessNoise
#

results_schema.ts view source

value + type

{ pairs: number; median: number; p95: number; max: number; } import {BenchProcessNoise} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

How far apart a run's own processes came out: an A/A figure from the run itself. Each library on each cell was measured by several processes, which should agree, and every pair of them gives a deviation. It is fuz_util's StatsPairwiseDeviation, restated here so the schema depends on zod alone.

pairs

type number

median

type number

p95

type number

max

type number

BenchProvenance
#

results_schema.ts view source

value + type

{ repo: string; commit: string; path: string; sha256: string; license: string; note: string | null; } import {BenchProvenance} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

One file an input came from, pinned so the input can be rebuilt and checked.

repo

type string

commit

type string

path

type string

sha256

type string

license

type string

note

type string | null

BenchResults
#

results_schema.ts view source

value + type

{ meta: { generated_at: string | null; machine: { name: string; cpu: string; threads: number | null; governor: string | null; cpufreq_driver: string | null; epp: string | null; boost: boolean | null; memory_gb: number; os_release: string; } | null; ... 10 more ...; bundler: { ...; } | ... 1 more ... | null; }; ... 8... import {BenchResults} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

One run of the benchmark. Beyond each section's shape, parsing checks that the sections agree: ids are unique and refer to roster entries, every cell describes its input as the inputs roster does and is named after it, no library has numbers for a language it doesn't claim or a cell it was excluded from, no cell covers an untimed language, a run with timed numbers has an anchor, its run parameters, and where it came from, a run with no filters has no gap (bench_results_find_gaps, and for a full run bench_results_find_startup_gaps), each deterministic number of an input is stated on one cell, and bundle sizes cover every library and set or none, as the install footprints cover every library and the compressed HTML sizes every library with an HTML size.

meta

type BenchMeta

langs

type BenchLang[]

sets

type BenchSet[]

inputs

type BenchInput[]

cells

type BenchCell[]

startup

type BenchStartup[]

bundle

type Record<string, Record<string, BenchBundleEntry>>

install

type Record<string, BenchInstall>

heap

type Record<string, Record<string, BenchHeap>>

coverage

type Record<string, Record<string, BenchCoverageEntry>>

BenchResultsCoverage
#

results_schema.ts view source

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

The parts of a results file that say whether it has a gap.

meta

type { libraries: { id: string; }[]; excluded: { cell: string; library: string; reason: string; }[]; }

langs

type BenchLang[]

inputs

type { file: string; lang: string; }[]

cells

type Pick<BenchCell, "id" | "output" | "lang" | "values" | "mode" | "tokens">[]

coverage

type Record<string, Record<string, unknown>>

BenchResultsGap
#

results_schema.ts view source

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

Something a results file lacks that a complete run would have, and where.

path

type (string | number)[]

message

type string

BenchResultsStartupCoverage
#

results_schema.ts view source

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

The parts of a results file that say whether its cold start has a gap.

meta

type { libraries: { id: string; }[]; startup_excluded: BenchStartupKey[]; }

langs

type BenchLang[]

sets

type { id: string; langs: string[]; }[]

startup

type BenchStartupKey[]

coverage

type Record<string, Record<string, unknown>>

BenchRun
#

results_schema.ts view source

value + type

{ kind: "full" | "smoke" | "calibrate"; passes: number; rounds: number; target_ms: number; warmup_ms: number; rewarm_ms: number; retries: number; loaded_langs: "cell"; collection: "minor"; startup_samples: number | null; ... 5 more ...; load_at_start: number; } import {BenchRun} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

How the timed numbers of a run were measured: its cells and its cold-start scenarios. It tells a complete full run from a smoke, calibration, or partial run: see bench_results_is_publishable.

kind

type "full" | "smoke" | "calibrate"

passes

type number

rounds

type number

target_ms

type number

warmup_ms

type number

rewarm_ms

type number

retries

type number

loaded_langs

type "cell"

collection

type "minor"

startup_samples

type number | null

startup_discard

type number | null

startup_compile_cache

type "disabled" | null

filters

type BenchRunFilters

segments

type number

duration_ms

type number

load_at_start

type number

BenchRunFilters
#

results_schema.ts view source

value + type

{ libraries: string[] | null; langs: string[] | null; sizes: ("micro" | "small" | "medium" | "large")[] | null; modes: ("tokenize" | "html")[] | null; sources: ("neutral" | "shiki" | "home" | "harness" | "stress")[] | null; metrics: ("throughput" | "startup")[] | null; } import {BenchRunFilters} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

The filters a run was restricted by. Each is null when the run was not restricted on that axis. libraries and langs narrow the cells and the cold-start scenarios alike; sizes, modes, and sources select inputs, so they narrow the cells only.

libraries

type string[] | null

langs

type string[] | null

sizes

type ("micro" | "small" | "medium" | "large")[] | null

modes

type ("tokenize" | "html")[] | null

sources

type ("neutral" | "shiki" | "home" | "harness" | "stress")[] | null

metrics

type ("throughput" | "startup")[] | null

BenchRunKind
#

results_schema.ts view source

value + type

"full" | "smoke" | "calibrate"

type "full" | "smoke" | "calibrate"

import {BenchRunKind} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

What a run is: full measures with the published parameters, smoke runs every cell once to prove the harness works and its numbers mean nothing, and calibrate measures every library twice in every cell to find the noise floor.

BenchRunMetric
#

results_schema.ts view source

value + type

"throughput" | "startup"

type "throughput" | "startup"

import {BenchRunMetric} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

A machine-dependent measurement a run makes: throughput is the timed cells, and startup is cold start.

BenchSet
#

results_schema.ts view source

value + type

{ id: string; label: string; langs: string[]; footnote: string | null; } import {BenchSet} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

A named list of languages that bundle size is measured over.

id

type string

label

type string

langs

type string[]

footnote

type string | null

BenchSize
#

results_schema.ts view source

value + type

"micro" | "small" | "medium" | "large"

type "micro" | "small" | "medium" | "large"

import {BenchSize} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

An input's size tier, by real file size.

BenchSource
#

results_schema.ts view source

value + type

"neutral" | "shiki" | "home" | "harness" | "stress"

type "neutral" | "shiki" | "home" | "harness" | "stress"

import {BenchSource} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

Who an input came from: neutral is real code no measured library authored, shiki is Shiki's upstream benchmark samples, home is one library's own samples, and harness is a snippet written for this benchmark.

BenchStartup
#

results_schema.ts view source

value + type

{ 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; } import {BenchStartup} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

One cold-start measurement. Each sample is a fresh Node process that does the scenario's work and nothing else, and its time is the process's own clock when the work is done, which counts from the start of the process. So every time includes Node starting up, and the bare entry is that part alone. Machine-dependent.

samples

type number

median_ms

type number

p10_ms

type number

p90_ms

type number

spread

type number

rss_peak_bytes

type number

scenario

type "set" | "bare" | "core" | "lang" | "first_highlight"

library

type string | null

lang

type string | null

set

type string | null

bundled

type boolean

BenchStartupExcluded
#

results_schema.ts view source

value + type

{ library: string; reason: string; scenario: "set" | "bare" | "core" | "lang" | "first_highlight"; lang: string | null; set: string | null; bundled: boolean; } import {BenchStartupExcluded} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

A cold-start scenario a library was not sampled in: its first process there failed to import, exported nothing, or highlighted with too few kinds of span. Distinct from unsupported, which is a scenario whose languages the library doesn't claim, and which has no entry anywhere.

library

type string

reason

type string

scenario

type "set" | "bare" | "core" | "lang" | "first_highlight"

lang

type string | null

set

type string | null

bundled

type boolean

BenchStartupKey
#

results_schema.ts view source

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

What tells one cold-start scenario from another.

set

type string | null

library

type string | null

lang

type string | null

scenario

type "set" | "bare" | "core" | "lang" | "first_highlight"

bundled

type boolean

BenchStartupScenario
#

results_schema.ts view source

value + type

"set" | "bare" | "core" | "lang" | "first_highlight"

type "set" | "bare" | "core" | "lang" | "first_highlight"

import {BenchStartupScenario} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

What a cold-start sample does before it stops the clock: bare is Node alone, core imports a library with no language, lang imports it with one language, set imports it with a feature set's languages, and first_highlight imports it with one language and highlights once.

BUNDLE_COMPRESSIONS
#

BUNDLE_VIEWS
#

bundle_matrix.ts view source

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
#

bundle_matrix.ts view source

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
#

bundle_matrix.ts view source

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

What the bundle tables show.

langs

type readonly string[]

set

The id of the set of several languages to sum and to read wasm and CSS from.

type string

compression

type BundleCompression

BundleView
#

bundle_matrix.ts view source

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.

CellGroup
#

cell_groups.ts view source

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

The cells of one language from one source.

key

type string

lang

type BenchLang

source_key

type string

cells

type BenchCell[]

CellSelection
#

cell_groups.ts view source

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

Which cells to show.

langs

type readonly string[]

sizes

type readonly string[]

sources

type readonly string[]

modes

type readonly string[]

CombinedSet
#

bundle_matrix.ts view source

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.

ids

The ids of the sets that hold these languages, the first being the one measured.

type string[]

label

type string

langs

type string[]

footnote

type string | null

coverage_claims_lang
#

matrix.ts view source

(coverage: Record<string, Record<string, true | { via: string; }>>, library: string, lang: string): boolean import {coverage_claims_lang} from '@ryanatkn/syntax-highlighter-bench/matrix.js';

Whether a library's coverage claims a language.

coverage

type Record<string, Record<string, BenchCoverageEntry>>

library

type string

lang

type string

returns

boolean

CoverageCell
#

coverage_matrix.ts view source

CoverageCell

type { kind: "direct"; } | { kind: "via"; footnote: number; } | { kind: "unsupported"; }

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

How one library covers one language.

CoverageMatrix
#

coverage_matrix.ts view source

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

A coverage matrix: a row of cells by library id for each language, and the footnotes.

rows

type { lang: { id: string; label: string; timed: boolean; }; cells: Record<string, CoverageCell>; }[]

footnotes

The footnote texts. A cell's footnote is an index into them.

type string[]

CoverageTable
#

decode_results_filters
#

results_filters.ts view source

(params: Pick<URLSearchParams, "get">, options: ResultsFilterOptions, defaults: ResultsFilters): ResultsFilters import {decode_results_filters} from '@ryanatkn/syntax-highlighter-bench/results_filters.js';

Reads a selection from a query. Ids come back in the order of options, each once.

params

the query, which may hold anything

type Pick<URLSearchParams, "get">

options

the ids each filter can hold

defaults

what a filter is when its parameter is absent or holds nothing valid

returns

ResultsFilters

DEFAULT_FORM
#

results_filters.ts view source

"bundled" import {DEFAULT_FORM} from '@ryanatkn/syntax-highlighter-bench/results_filters.js';

The form of a cold start selected by default: the chunk whose size is reported.

DEFAULT_HEAP_MEASURE
#

heap_matrix.ts view source

HeapMeasure

type HeapMeasure

import {DEFAULT_HEAP_MEASURE} from '@ryanatkn/syntax-highlighter-bench/heap_matrix.js';

The measure shown by default: the sum, which is what is ranked.

DEFAULT_OUTPUT_COMPRESSION
#

results_filters.ts view source

"raw" import {DEFAULT_OUTPUT_COMPRESSION} from '@ryanatkn/syntax-highlighter-bench/results_filters.js';

How the HTML's size is shown by default: raw, as the output table has always shown it.

DEFAULT_SET
#

results_filters.ts view source

"docs" import {DEFAULT_SET} from '@ryanatkn/syntax-highlighter-bench/results_filters.js';

The set summed by default, when the file has it: what a documentation site imports.

DEFAULT_SOURCE
#

results_filters.ts view source

"neutral" import {DEFAULT_SOURCE} from '@ryanatkn/syntax-highlighter-bench/results_filters.js';

The source selected by default: the primary set, which no measured library authored.

describe_bench_run
#

results_schema.ts view source

(results: { meta: { generated_at: string | null; machine: { name: string; cpu: string; threads: number | null; governor: string | null; cpufreq_driver: string | null; epp: string | null; boost: boolean | null; memory_gb: number; os_release: string; } | null; ... 10 more ...; bundler: { ...; } | ... 1 more ... | null; }; ... 8 more ...; coverage: Record<...>; }): string import {describe_bench_run} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

The facts of a run that decide whether it is publishable, as one line for an error.

results

returns

string

docs_data_context
#

docs_data.ts view source

{ get: (error_message?: string | undefined) => () => DocsData; get_maybe: () => (() => DocsData) | undefined; set: (value: () => DocsData) => () => DocsData; } import {docs_data_context} from '@ryanatkn/syntax-highlighter-bench/docs_data.js';

The docs data, set by the docs layout from its load and read by the tomes.

DocsData
#

docs_data.ts view source

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

The parts of the rendered results file that the docs pages show.

source

type SiteResultsSource

langs

type BenchLang[]

sets

type BenchSet[]

inputs

type BenchInput[]

corpus_hash

type string

corpus_current

Whether the inputs are the repository's corpus as it is committed.

type boolean

machine

The name of the machine the timed numbers came from, or null when nothing was timed.

type string | null

noise_floor

type BenchNoiseFloor | null

encode_results_filters
#

results_filters.ts view source

(filters: ResultsFilters, defaults: ResultsFilters): URLSearchParams import {encode_results_filters} from '@ryanatkn/syntax-highlighter-bench/results_filters.js';

The query that restores a selection. Only what differs from the defaults is written, so the default view has an empty query. A list is its ids joined by commas, and an empty list is an empty value.

filters

defaults

returns

URLSearchParams

ENGINE_LABELS
#

library_labels.ts view source

Record<"scanner" | "grammar_vm" | "regex" | "textmate", string>

type Record<"scanner" | "grammar_vm" | "regex" | "textmate", string>

import {ENGINE_LABELS} from '@ryanatkn/syntax-highlighter-bench/library_labels.js';

The name of each engine kind.

FilterGroup
#

FilterGroup.svelte view source

import FilterGroup from '@ryanatkn/syntax-highlighter-bench/FilterGroup.svelte';

legend

type string

options

Every choice, in display order.

type readonly { id: string; label: string; }[]

selected

The ids of the checked choices.

type readonly string[]

onchange

Called with the checked ids, in the order of options.

type (selected: string[]) => void

FilterSelect
#

FilterSelect.svelte view source

import FilterSelect from '@ryanatkn/syntax-highlighter-bench/FilterSelect.svelte';

label

type string

options

Every choice, in display order.

type readonly { id: string; label: string; }[]

value

The id of the selected choice.

type string

onchange

type (value: string) => void

find_core_set
#

bundle_matrix.ts view source

(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.

sets

type readonly BenchSet[]

returns

BenchSet | null

find_first_difference
#

site_results.ts view source

(a: unknown, b: unknown, path?: string): string | null import {find_first_difference} from '@ryanatkn/syntax-highlighter-bench/site_results.js';

The path of the first place two JSON values differ, or null when they are equal. Object keys are compared as sets, so their order doesn't matter.

a

type unknown

b

type unknown

path

type string
default ''

returns

string | null

find_moved_since
#

site_results.ts view source

(run: { meta: { generated_at: string | null; machine: { name: string; cpu: string; threads: number | null; governor: string | null; cpufreq_driver: string | null; epp: string | null; boost: boolean | null; memory_gb: number; os_release: string; } | null; ... 10 more ...; bundler: { ...; } | ... 1 more ... | null; }; ... 8 more ...; coverage: Record<...>; }, deterministic: { ...; }): string[] import {find_moved_since} from '@ryanatkn/syntax-highlighter-bench/site_results.js';

What differs between a published run and the deterministic results in the things a deterministic number depends on: each library's version with its extra packages, the versions of its dependencies (its install closure), the corpus, and what built and compressed the bundles (BenchBundler), when both files hold bundle sizes.

run

deterministic

returns

string[]

a phrase for each thing that moved, none when the run describes the same libraries, corpus, and bundler as the deterministic results

find_single_set
#

bundle_matrix.ts view source

(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.

sets

type readonly BenchSet[]

lang

type string

returns

BenchSet | null

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

find_timed_set
#

bundle_matrix.ts view source

(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.

sets

type readonly BenchSet[]

langs

type readonly BenchLang[]

returns

BenchSet | null

find_without_set
#

bundle_matrix.ts view source

(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.

sets

type readonly BenchSet[]

langs

type readonly BenchLang[]

lang

type string

returns

BenchSet | null

FixtureBanner
#

format_bytes
#

bench_format.ts view source

(bytes: number): string import {format_bytes} from '@ryanatkn/syntax-highlighter-bench/bench_format.js';

A byte count in decimal units, where 1 kB is 1,000 bytes. A negative count keeps its sign, since a difference between two sizes can be one.

bytes

type number

returns

string

format_cell_group_label
#

cell_groups.ts view source

(group: CellGroup): string import {format_cell_group_label} from '@ryanatkn/syntax-highlighter-bench/cell_groups.js';

The label of a cell group: its language and its source.

group

returns

string

format_count
#

bench_format.ts view source

(n: number): string import {format_count} from '@ryanatkn/syntax-highlighter-bench/bench_format.js';

A count with thousands separators.

n

type number

returns

string

format_date
#

bench_format.ts view source

(iso: string): string import {format_date} from '@ryanatkn/syntax-highlighter-bench/bench_format.js';

The UTC date of an ISO timestamp, as YYYY-MM-DD.

iso

type string

returns

string

format_hash
#

bench_format.ts view source

(hash: string): string import {format_hash} from '@ryanatkn/syntax-highlighter-bench/bench_format.js';

A commit or content hash shortened for display, keeping a -dirty marker.

hash

type string

returns

string

format_library_tag
#

library_labels.ts view source

(id: string): string import {format_library_tag} from '@ryanatkn/syntax-highlighter-bench/library_labels.js';

The name of an engine kind or an output shape, or the id for one it doesn't know.

id

type string

returns

string

format_matrix_value
#

matrix.ts view source

(value: number, unit: MatrixUnit): string import {format_matrix_value} from '@ryanatkn/syntax-highlighter-bench/matrix.js';

A row's number as text, in the row's unit.

value

type number

unit

returns

string

format_ms
#

bench_format.ts view source

(ms: number): string import {format_ms} from '@ryanatkn/syntax-highlighter-bench/bench_format.js';

A duration given in milliseconds.

ms

type number

returns

string

format_ns
#

bench_format.ts view source

(ns: number): string import {format_ns} from '@ryanatkn/syntax-highlighter-bench/bench_format.js';

A duration given in nanoseconds, in the unit that keeps it readable.

ns

type number

returns

string

format_percent
#

bench_format.ts view source

(fraction: number): string import {format_percent} from '@ryanatkn/syntax-highlighter-bench/bench_format.js';

A fraction as a percentage: 0.033 is 3.3%.

fraction

type number

returns

string

format_provenance
#

corpus_inputs.ts view source

(provenance: Pick<{ repo: string; commit: string; path: string; sha256: string; license: string; note: string | null; }, "commit" | "repo">): string import {format_provenance} from '@ryanatkn/syntax-highlighter-bench/corpus_inputs.js';

An upstream file as owner/repo@commit, the commit shortened.

provenance

type Pick<BenchProvenance, "commit" | "repo">

returns

string

format_ratio
#

bench_format.ts view source

(ratio: number): string import {format_ratio} from '@ryanatkn/syntax-highlighter-bench/bench_format.js';

A ratio as a factor: 1.00ร—, 12.3ร—, 140ร—.

ratio

type number

returns

string

format_significant
#

bench_format.ts view source

(n: number): string import {format_significant} from '@ryanatkn/syntax-highlighter-bench/bench_format.js';

A number to about three significant digits: two decimals under 10, one under 100, and a whole count from there.

n

type number

returns

string

format_source_key
#

cell_groups.ts view source

(key: string): string import {format_source_key} from '@ryanatkn/syntax-highlighter-bench/cell_groups.js';

A source key's label: the source, naming the owner of a home input.

key

type string

returns

string

format_source_note
#

cell_groups.ts view source

(key: string): string import {format_source_note} from '@ryanatkn/syntax-highlighter-bench/cell_groups.js';

What a source key's inputs are, naming whose samples a home input is.

key

type string

returns

string

group_cells
#

cell_groups.ts view source

(results: Pick<MatrixResults, "langs" | "cells">, selection: CellSelection): CellGroup[] import {group_cells} from '@ryanatkn/syntax-highlighter-bench/cell_groups.js';

The selected cells in groups of one language and one source, in roster and source order. Within a group the cells are ordered by size, then file, then mode.

results

type Pick<MatrixResults, "langs" | "cells">

selection

returns

CellGroup[]

group_inputs
#

corpus_inputs.ts view source

(inputs: readonly { file: string; source: "neutral" | "shiki" | "home" | "harness" | "stress"; home: string | null; lang: string; size: "micro" | "small" | "medium" | "large"; bytes: number; lines: number; sha256: string; synthetic: boolean; provenance: { ...; }[]; derivation: string | null; }[]): InputGroup[] import {group_inputs} from '@ryanatkn/syntax-highlighter-bench/corpus_inputs.js';

The inputs in groups of one source, in source order, each ordered by file.

inputs

type readonly BenchInput[]

returns

InputGroup[]

HASH_LABEL_LENGTH
#

bench_format.ts view source

10 import {HASH_LABEL_LENGTH} from '@ryanatkn/syntax-highlighter-bench/bench_format.js';

How many characters of a hash the site prints.

HEADLINE_COMPRESSION
#

headline.ts view source

"gzip" import {HEADLINE_COMPRESSION} from '@ryanatkn/syntax-highlighter-bench/headline.js';

The compression the headline bundle sizes are shown in.

HeadlineChart
#

headline.ts view source

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

A headline figure drawn as bars, with what its heading says.

row

type MatrixRow

title

type string

note

type string

details

Whether each bar shows its number's details beneath it.

type boolean

HEAP_MEASURES
#

heap_matrix.ts view source

readonly { id: HeapMeasure; label: string; note: string; compared: boolean; }[] import {HEAP_MEASURES} from '@ryanatkn/syntax-highlighter-bench/heap_matrix.js';

Every measure, in display order, with its label and whether its rows are compared.

HEAP_MOVED
#

site_results.ts view source

"the retained heaps, which move with the Node version they are read on" import {HEAP_MOVED} from '@ryanatkn/syntax-highlighter-bench/site_results.js';

What moved says when the retained heaps differ beyond a reading's jitter.

heap_readings_agree
#

results_schema.ts view source

(a: number, b: number): boolean import {heap_readings_agree} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

Whether two heap readings, in KiB, are the same reading: within HEAP_TOLERANCE_KB, or HEAP_TOLERANCE_RATIO of the larger, whichever is larger.

a

type number

b

type number

returns

boolean

HEAP_TOLERANCE_KB
#

bench_constants.ts view source

16 import {HEAP_TOLERANCE_KB} from '@ryanatkn/syntax-highlighter-bench/bench_constants.js';

Two retained-heap readings (BenchHeap), in KiB, are the same reading when they are this close, or HEAP_TOLERANCE_RATIO of the larger, whichever is larger. Readings agree to well under a kibibyte; the margin keeps a reading from being the one number of the deterministic file that fails a check on an unchanged tree.

HEAP_TOLERANCE_RATIO
#

HeapMeasure
#

heap_matrix.ts view source

HeapMeasure

type "total" | "retained" | "code" | "external"

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

A number of a retained heap, or the three summed.

InputGroup
#

corpus_inputs.ts view source

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

The inputs of one source.

source_key

type string

label

type string

note

type string

inputs

type BenchInput[]

InputsTable
#

INSTALL_MEASURES
#

bundle_matrix.ts view source

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.

LibrariesTable
#

LIBRARY_COLORS
#

library_labels.ts view source

readonly string[] import {LIBRARY_COLORS} from '@ryanatkn/syntax-highlighter-bench/library_labels.js';

One color per library, by its place in the roster, so a library's bars are the same color in every chart. The ratio beside a bar carries the verdict, colored by the ratio scale, as tsv's benchmark charts do.

LibraryLabel
#

load_site_results
#

server/site_results_load.ts view source

(options: LoadSiteResultsOptions): SiteResults import {load_site_results} from '@ryanatkn/syntax-highlighter-bench/server/site_results_load.js';

Reads and validates the results the site renders. The fixture file is read only when fixture is set, so a default build never opens it.

options

returns

SiteResults

throws

  • Error - if a file is missing that must exist, or as `resolve_site_results` does

load_site_results_for_build
#

server/site_results_load.ts view source

(): SiteResults import {load_site_results_for_build} from '@ryanatkn/syntax-highlighter-bench/server/site_results_load.js';

The results for this process: the working directory's files, and its environment's choice.

returns

SiteResults

LoadSiteResultsOptions
#

server/site_results_load.ts view source

LoadSiteResultsOptions import type {LoadSiteResultsOptions} from '@ryanatkn/syntax-highlighter-bench/server/site_results_load.js';

Where the results files are, and whether to render the fixture.

dir

The repository root.

type string

fixture

Whether the fixture run is rendered in place of real results.

type boolean

logo_syntax_highlighter_bench
#

logo.ts view source

SvgData import {logo_syntax_highlighter_bench} from '@ryanatkn/syntax-highlighter-bench/logo.js';

The site's mark: a bench built from highlighted code, its backrest and seat lines of colored tokens on two posts. static/logo.svg and static/favicon.png are the same drawing.

matrix_row_baseline
#

matrix.ts view source

(row: MatrixRow, libraries: readonly string[], reference: string | null): number | null import {matrix_row_baseline} from '@ryanatkn/syntax-highlighter-bench/matrix.js';

The number a row's ratios are taken against: the reference library's, or the best among the libraries when no reference is chosen.

When any of the libraries' numbers can't be ranked (one that isn't positive, or one marked unranked), the best of the rest is never used: the number set aside may be the smallest in the row. A row with a resolution is then compared with that resolution, and a row without one has no baseline.

row

libraries

type readonly string[]

reference

a library id, or null for the best in the row

type string | null

returns

number | null

the baseline, or null when the row isn't compared, a number in it can't be ranked and the row has no resolution, the reference has no number, or no library has one

matrix_row_entry
#

matrix.ts view source

(row: MatrixRow, library: string): MatrixEntry import {matrix_row_entry} from '@ryanatkn/syntax-highlighter-bench/matrix.js';

A library's entry in a row.

row

library

type string

returns

MatrixEntry

matrix_row_is_bounded
#

matrix.ts view source

(row: MatrixRow, libraries: readonly string[], reference: string | null): boolean import {matrix_row_is_bounded} from '@ryanatkn/syntax-highlighter-bench/matrix.js';

Whether a row's ratios are lower bounds: its baseline is the row's resolution, because the smallest numbers in it are below what can be told apart. The true ratio to the best is at least the one shown.

row

libraries

type readonly string[]

reference

type string | null

returns

boolean

matrix_row_is_complete
#

matrix.ts view source

(row: MatrixRow, libraries: readonly string[]): boolean import {matrix_row_is_complete} from '@ryanatkn/syntax-highlighter-bench/matrix.js';

Whether every one of the libraries has a number in the row that a ratio can be made from. Only such a row enters a geometric mean.

row

libraries

type readonly string[]

returns

boolean

matrix_row_value
#

matrix.ts view source

(row: MatrixRow, library: string): number | null import {matrix_row_value} from '@ryanatkn/syntax-highlighter-bench/matrix.js';

A library's number in a row, or null when its entry is anything else.

row

library

type string

returns

number | null

matrix_rows_max
#

matrix.ts view source

(rows: readonly MatrixRow[], libraries: readonly string[]): number import {matrix_rows_max} from '@ryanatkn/syntax-highlighter-bench/matrix.js';

The largest finite number of these libraries over these rows, which a full bar stands for: 0 when there is none.

rows

type readonly MatrixRow[]

libraries

type readonly string[]

returns

number

MatrixBadge
#

matrix.ts view source

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

A short mark on a value that a reader should weigh, with the reason.

text

type string

title

type string

MatrixCell
#

MatrixCell.svelte view source

import MatrixCell from '@ryanatkn/syntax-highlighter-bench/MatrixCell.svelte';

entry

unit

ratio?

The value's ratio against the row's baseline, when it has one.

type number
optional

floor?

The noise floor a ratio is read against, or null for none.

type number | null
optional default null

bound?

Whether the ratio is a lower bound: the true one is at least it.

type boolean
optional default false

colored?

Whether the ratio tints the cell. Off where a smaller number is not a better one.

type boolean
optional default true

open?

Whether the details are shown in the cell. They are always in its title.

type boolean
optional default false

bar?

The length of a bar beneath the number, as a fraction of the table's largest, or null for none.

type number | null
optional default null

reference?

Whether this is the reference library's column, which every ratio is taken against.

type boolean
optional default false

MatrixEntry
#

matrix.ts view source

MatrixEntry

type MatrixValue | { kind: "unsupported"; langs: string[]; } | { kind: "excluded"; reason: string; } | { kind: "none"; text: string; } | { kind: "unmeasured"; }

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

One library's place in a row: a number, or why there is none.

MatrixGroup
#

matrix.ts view source

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

Rows under one heading.

key

type string

label

type string

note

type string | null

rows

type MatrixRow[]

MatrixResults
#

matrix.ts view source

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

A results file as the results pages receive it: without the corpus inputs.

langs

type BenchLang[]

startup

type BenchStartup[]

meta

type BenchMeta

sets

type BenchSet[]

cells

type BenchCell[]

bundle

type Record<string, Record<string, BenchBundleEntry>>

install

type Record<string, BenchInstall>

heap

type Record<string, Record<string, BenchHeap>>

coverage

type Record<string, Record<string, BenchCoverageEntry>>

MatrixRow
#

matrix.ts view source

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

One row of a table: a cell of the benchmark, or a summary over cells.

key

type string

kind

type "cell" | "summary"

label

type string

note

type string | null

unit

type MatrixUnit

direction

type RatioDirection

compared

Whether the row's numbers are compared: a row that is not has no ratios.

type boolean

floor

The noise floor the row's ratios are read against, as BenchNoiseFloor holds it, or null for a row with none: only a timed throughput row has one.

type number | null

resolution

The smallest difference the row can tell apart, in the row's unit, or null for a row whose numbers are all exact. When a number in the row is below it, the others are compared with it, as lower bounds. Only a cold-start row has one.

type number | null

entries

By library id. A library with no entry reads as unmeasured.

type Record<string, MatrixEntry>

empty

Set in place of entries when the row has nothing to show for any library.

type string | null

MatrixTable
#

MatrixTable.svelte view source

accepts children

import MatrixTable from '@ryanatkn/syntax-highlighter-bench/MatrixTable.svelte';

libraries

The libraries shown, in column order.

type readonly BenchLibrary[]

groups

type readonly MatrixGroup[]

heading

The heading of the first column: what a row is.

type string

label

The accessible name of the table's scrolling region.

type string

reference?

The library every ratio is taken against, or null for the best in each row.

type string | null
optional default null

colored?

Whether ratios tint their cells.

type boolean
optional default true

summaries?

Whether a summary row is set apart from the cells it summarizes. Off where every row is a figure of its own.

type boolean
optional default true

bars?

Whether each number draws a bar beneath it, on one scale across its group, so a group's rows compare with each other as well as across.

type boolean
optional default false

collapsible?

What a group's cell rows are, when a group with summary rows shows only those until it is opened, or null to show every row.

type string | null
optional default null

fold_unsummarized?

Whether a group with no summary row folds too, down to its header. Off where such a group is a figure of its own, as a cold start's single scenario is.

type boolean
optional default false

children

The caption's lead: what the table shows.

type Snippet<[]>

more?

How to read the table, folded under the lead.

type Snippet<[]>
optional

MatrixUnit
#

matrix.ts view source

MatrixUnit

type "bytes" | "ops_per_sec" | "mb_per_sec" | "ns" | "ms" | "count"

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

What a row's numbers are, which decides how they print.

MatrixValue
#

matrix.ts view source

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

A number in a row, with what a reader may want to know about it.

kind

type "value"

value

type number

text

Printed in place of the number, when the number itself would mislead.

type string | null

details

type string[]

badges

type MatrixBadge[]

unranked

Why the number can't be compared with another, or null when it can. Such a number has no ratio, and its row is left out of a geometric mean.

type string | null

OUTPUT_LABELS
#

library_labels.ts view source

Record<"classes" | "inline_styles", string>

type Record<"classes" | "inline_styles", string>

import {OUTPUT_LABELS} from '@ryanatkn/syntax-highlighter-bench/library_labels.js';

The name of each output shape.

OUTPUT_MEASURES
#

output_matrix.ts view source

readonly { id: OutputMeasure; label: string; mode: "tokenize" | "html"; unit: MatrixUnit; }[] import {OUTPUT_MEASURES} from '@ryanatkn/syntax-highlighter-bench/output_matrix.js';

Every output measure, with its label, the mode whose cell states it, and its unit.

OutputMeasure
#

output_matrix.ts view source

OutputMeasure

type "tokens" | "html_bytes" | "spans"

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

A deterministic number of a cell: its token count, or a size of its HTML.

OutputSelection
#

output_matrix.ts view source

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

Which inputs and which of their numbers the output tables show.

inheritance

extends: Omit<CellSelection, 'modes'>

measures

type readonly string[]

compression

How the HTML's size is shown: raw, or compressed at the bundle sizes' levels.

type BundleCompression

parse_bench_results
#

results_schema.ts view source

(data: unknown): { meta: { generated_at: string | null; machine: { name: string; cpu: string; threads: number | null; governor: string | null; cpufreq_driver: string | null; epp: string | null; boost: boolean | null; memory_gb: number; os_release: string; } | null; ... 10 more ...; bundler: { ...; } | ... 1 more ... | null; }; ... 8 more ...; coverage: Record<...>; } import {parse_bench_results} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

Parses a results file, with every problem in one readable message.

data

the parsed JSON of a results file

type unknown

returns

BenchResults

the validated results

throws

  • if - the data doesn't match `BenchResults`

PRACTICE_BLOCK_BYTES
#

headline.ts view source

10000 import {PRACTICE_BLOCK_BYTES} from '@ryanatkn/syntax-highlighter-bench/headline.js';

The size of the code block the practical figures are worked out for, in bytes.

PRACTICE_BUILD_BYTES
#

headline.ts view source

1000000 import {PRACTICE_BUILD_BYTES} from '@ryanatkn/syntax-highlighter-bench/headline.js';

The source a site build might highlight, in bytes.

PRACTICE_FRAME_MS
#

headline.ts view source

16 import {PRACTICE_FRAME_MS} from '@ryanatkn/syntax-highlighter-bench/headline.js';

One frame at 60 frames a second, the budget an editor highlighting as you type works in.

Provenance
#

Provenance.svelte view source

accepts children

import Provenance from '@ryanatkn/syntax-highlighter-bench/Provenance.svelte';

meta

moved?

What has changed since the run was measured, as SiteResults holds it.

type readonly string[]
optional default []

children?

Shown after the provenance line, in the same paragraph: links to the method.

type Snippet<[]>
optional

ratio_is_within_floor
#

ratio.ts view source

(ratio: number, floor: number): boolean import {ratio_is_within_floor} from '@ryanatkn/syntax-highlighter-bench/ratio.js';

Whether a ratio is inside a noise floor: the two numbers differ by no more than the machine shows between two measurements of the same library.

ratio

type number

floor

a deviation as BenchNoiseFloor holds it; 0.03 is 3%

type number

returns

boolean

RATIO_LEVEL_COLORS
#

ratio.ts view source

readonly string[] import {RATIO_LEVEL_COLORS} from '@ryanatkn/syntax-highlighter-bench/ratio.js';

The color of each level, as fuz_css variables that adapt to the color scheme: better than the reference, level with the baseline, then five steps worse, through yellow, orange, red, and brown to purple.

RATIO_LEVEL_LIMITS
#

ratio.ts view source

readonly number[] import {RATIO_LEVEL_LIMITS} from '@ryanatkn/syntax-highlighter-bench/ratio.js';

The ratios under which each level of the scale ends. A ratio at or past the last one is the last level. The scale reaches 100, since the libraries measured here are up to hundreds of times apart: a scale that stopped at a few times would color most of a table alike.

RatioDirection
#

ratio.ts view source

RatioDirection

type "lower" | "higher"

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

Whether a smaller or a larger number is the better one.

RatioLegend
#

RatioLegendEntry
#

ratio.ts view source

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

One level of the color scale as a key shows it: its color and the ratios it covers.

color

type string

label

type string

note

What the level means, beyond its ratios, or null.

type string | null

REFERENCE_PARAM
#

results_filters.ts view source

"reference" import {REFERENCE_PARAM} from '@ryanatkn/syntax-highlighter-bench/results_filters.js';

The query parameter of the reference library.

resolve_site_results
#

site_results.ts view source

(files: SiteResultsFiles): SiteResults import {resolve_site_results} from '@ryanatkn/syntax-highlighter-bench/site_results.js';

Chooses and validates the results the site renders. Every file given is parsed through parse_bench_results, so no number reaches a page unchecked.

  • With a fixture, the fixture, as fixture: the build asked for it.
  • Otherwise with a latest run, that run, as published. It must pass bench_results_is_publishable, with no exception: a run whose anchor drifted is refused like a smoke run.
  • Otherwise the deterministic results, as deterministic.

A published run is checked against the deterministic results. When both describe the same library versions and corpus, their deterministic numbers (sets, coverage, bundle sizes, install footprints, and each cell's token counts and output sizes, raw and compressed) must be equal. When a version or the corpus has moved since the run, the run is rendered as the snapshot it is, and moved says what moved. When nothing has and the exact numbers agree, retained heaps beyond a reading's jitter (bench_heaps_agree) also make the run a snapshot, as HEAP_MOVED: they move with the Node version, which nothing else records.

files

returns

SiteResults

throws

  • Error - if a file doesn't parse, if the latest run is not publishable, if it disagrees with the deterministic results it should equal, or if the deterministic file holds a timed number

RESULTS_CHOICE_KEYS
#

results_filters.ts view source

readonly ["unit", "bundle", "compression", "output_compression", "set"] import {RESULTS_CHOICE_KEYS} from '@ryanatkn/syntax-highlighter-bench/results_filters.js';

The filters that hold one id.

results_have_heap
#

heap_matrix.ts view source

(results: Pick<MatrixResults, "heap">): boolean import {results_have_heap} from '@ryanatkn/syntax-highlighter-bench/heap_matrix.js';

Whether a file holds any retained heap.

results

type Pick<MatrixResults, "heap">

returns

boolean

results_have_throughput
#

throughput_matrix.ts view source

(results: Pick<MatrixResults, "cells">): boolean import {results_have_throughput} from '@ryanatkn/syntax-highlighter-bench/throughput_matrix.js';

Whether a results file holds any timed cell value.

results

type Pick<MatrixResults, "cells">

returns

boolean

RESULTS_LIST_KEYS
#

results_filters.ts view source

readonly ["metrics", "libraries", "engines", "outputs", "langs", "sizes", "modes", "sources", "forms", "measures", "parts"] import {RESULTS_LIST_KEYS} from '@ryanatkn/syntax-highlighter-bench/results_filters.js';

The filters that hold several ids.

RESULTS_METRICS
#

results_filters.ts view source

readonly { id: ResultsMetric; label: string; }[] import {RESULTS_METRICS} from '@ryanatkn/syntax-highlighter-bench/results_filters.js';

Every section, with its label, in display order.

ResultsFilterOptions
#

results_filters.ts view source

ResultsFilterOptions

type Record<"set" | "libraries" | "langs" | "sizes" | "modes" | "sources" | "metrics" | "bundle" | "engines" | "outputs" | "forms" | "measures" | "parts" | "unit" | "compression" | "output_compression", string[]> & { set_aliases: Record<string, string>; }

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

The ids each filter can hold, in display order.

set

type string[]

libraries

type string[]

langs

type string[]

sizes

type string[]

modes

type string[]

sources

type string[]

metrics

type string[]

bundle

type string[]

engines

type string[]

outputs

type string[]

forms

type string[]

measures

type string[]

parts

type string[]

unit

type string[]

compression

type string[]

output_compression

type string[]

set_aliases

Other ids a link may use for a set, each mapped to the id that stands for it: a set holding the same languages as another is shown under one id.

type Record<string, string>

ResultsFilters
#

results_filters.ts view source

ResultsFilters

type Record<"libraries" | "langs" | "sizes" | "modes" | "sources" | "metrics" | "engines" | "outputs" | "forms" | "measures" | "parts", string[]> & Record<"set" | "bundle" | "unit" | "compression" | "output_compression", string> & { reference: string | null; }

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

What a reader has selected on the results page.

libraries

type string[]

langs

type string[]

sizes

type string[]

modes

type string[]

sources

type string[]

metrics

type string[]

engines

type string[]

outputs

type string[]

forms

type string[]

measures

type string[]

parts

type string[]

set

type string

bundle

type string

unit

type string

compression

type string

output_compression

type string

reference

The library every ratio is taken against, or null for the best in each row.

type string | null

ResultsMetric
#

results_filters.ts view source

ResultsMetric

type "throughput" | "startup" | "output" | "bundle" | "heap"

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

A section of the results page.

SITE_DETERMINISTIC_PATH
#

server/site_results_load.ts view source

"results/deterministic.json" import {SITE_DETERMINISTIC_PATH} from '@ryanatkn/syntax-highlighter-bench/server/site_results_load.js';

The committed deterministic results, relative to the repository.

SITE_FIXTURE_ENV
#

server/site_results_load.ts view source

"BENCH_RESULTS_FIXTURE" import {SITE_FIXTURE_ENV} from '@ryanatkn/syntax-highlighter-bench/server/site_results_load.js';

The environment variable that makes a build or a dev server render the fixture run.

site_fixture_is_enabled
#

server/site_results_load.ts view source

(env: Record<string, string | undefined>): boolean import {site_fixture_is_enabled} from '@ryanatkn/syntax-highlighter-bench/server/site_results_load.js';

Whether an environment asks for the fixture run: the variable is exactly 1. Anything else, an unset variable included, is no.

env

type Record<string, string | undefined>

returns

boolean

SITE_FIXTURE_PATH
#

server/site_results_load.ts view source

"src/test/fixtures/results/fixture_run.json" import {SITE_FIXTURE_PATH} from '@ryanatkn/syntax-highlighter-bench/server/site_results_load.js';

The fixture run, whose numbers are invented, relative to the repository.

SITE_LATEST_PATH
#

server/site_results_load.ts view source

"results/latest.json" import {SITE_LATEST_PATH} from '@ryanatkn/syntax-highlighter-bench/server/site_results_load.js';

The latest published timed run, relative to the repository. Absent until one is published.

SiteResults
#

site_results.ts view source

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

The results the site renders, and where they came from.

source

type SiteResultsSource

results

type BenchResults

moved

What has changed since a published run was measured, one phrase for each thing: a library now at another version, or the corpus. Empty when the run describes the tree as it is, and for any other source.

type string[]

corpus_current

Whether the inputs of these results are the repository's corpus as it is committed: true for the deterministic results and for a published run of the same corpus, and false for a run of an earlier corpus and for the fixture.

type boolean

SiteResultsFiles
#

site_results.ts view source

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

The parsed JSON of each results file the site may render, null for one that is absent.

deterministic

The deterministic results, which are always committed.

type unknown

latest

The latest published timed run, or null when none is committed.

type unknown

fixture

The fixture run, given only when the build asked for it, and null otherwise.

type unknown

SiteResultsSource
#

site_results.ts view source

SiteResultsSource

type "deterministic" | "published" | "fixture"

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

Where the results a page shows came from:

  • deterministic - the committed deterministic results, with nothing timed
  • published - the latest published timed run
  • fixture - the test fixture, whose numbers are invented

SPREAD_DISTURBED_ABOVE
#

bench_constants.ts view source

1.25 import {SPREAD_DISTURBED_ABOVE} from '@ryanatkn/syntax-highlighter-bench/bench_constants.js';

A library whose rounds on a cell are further apart than this, slowest over fastest, was disturbed by something. A timed run measures it there again, the run's summary lists the ones still past it, and the site marks them.

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[]

THROUGHPUT_UNITS
#

throughput_matrix.ts view source

readonly { id: ThroughputUnit; label: string; }[] import {THROUGHPUT_UNITS} from '@ryanatkn/syntax-highlighter-bench/throughput_matrix.js';

Every throughput unit, with its label, in display order.

ThroughputSelection
#

ThroughputUnit
#

throughput_matrix.ts view source

ThroughputUnit

type "ns_per_op" | "ops_per_sec" | "mb_per_sec"

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

The number a throughput cell is shown as. mb_per_sec is the one to compare across inputs of different sizes.

to_bar_chart
#

bar_chart.ts view source

(row: MatrixRow, libraries: readonly string[], reference: string | null): BarChartItem[] import {to_bar_chart} from '@ryanatkn/syntax-highlighter-bench/bar_chart.js';

The bars of a row, in the order of libraries. A bar's length is its number over the largest in the row, whichever direction is better, so a longer bar is always more of the row's unit.

row

libraries

type readonly string[]

reference

the library the ratios are taken against, or null for the best in the row

type string | null

returns

BarChartItem[]

to_bench_cell_id
#

results_schema.ts view source

(file: string, mode: "tokenize" | "html"): string import {to_bench_cell_id} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

The id of a cell: its input's file and its mode, which together are unique in a run.

file

type string

mode

returns

string

to_bench_startup_key
#

results_schema.ts view source

(entry: BenchStartupKey): string import {to_bench_startup_key} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

The string a cold-start scenario is told apart by.

entry

returns

string

to_bound_color
#

ratio.ts view source

(ratio: number): string import {to_bound_color} from '@ryanatkn/syntax-highlighter-bench/ratio.js';

The color of a ratio that is only a lower bound. A bound is taken against a row's resolution, not against the best in the row, so it is never given the color of a number level with the baseline, however close to 1 it is: a number that is at least the resolution is worse than one inside it.

ratio

type number

returns

string

to_bundle_beside_group
#

bundle_matrix.ts view source

(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.

results

selection

type Pick<BundleSelection, "set" | "compression">

returns

MatrixGroup

to_bundle_cost_groups
#

bundle_matrix.ts view source

(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.

results

selection

returns

MatrixGroup[]

the groups, none for a file that measured no bundle

to_bundle_increment_entry
#

bundle_matrix.ts view source

(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.

results

type Pick<MatrixResults, "sets" | "bundle">

library

type string

lang

type string

compression

returns

MatrixEntry

to_bundle_loaded_entry
#

bundle_matrix.ts view source

(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.

results

type Pick<MatrixResults, "bundle">

library

type string

set

type BenchSet | null

compression

returns

MatrixEntry

to_bundle_marginal_entry
#

bundle_matrix.ts view source

(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.

results

type Pick<MatrixResults, "langs" | "sets" | "bundle">

library

type string

lang

type string

returns

MatrixEntry

to_bundle_size_entry
#

bundle_matrix.ts view source

(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.

results

type Pick<MatrixResults, "bundle">

library

type string

set

type BenchSet | null

compression

returns

MatrixEntry

to_bundle_sum_entry
#

bundle_matrix.ts view source

(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.

results

type Pick<MatrixResults, "sets" | "bundle">

library

type string

langs

type readonly string[]

compression

returns

MatrixEntry

to_bundle_total_groups
#

bundle_matrix.ts view source

(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.

results

selection

type Pick<BundleSelection, "set" | "compression">

returns

MatrixGroup[]

the groups, none for a file that measured no bundle

to_cell_label
#

cell_groups.ts view source

(cell: Pick<{ id: string; metric: "throughput"; lang: string; size: "micro" | "small" | "medium" | "large"; mode: "tokenize" | "html"; source: "neutral" | "shiki" | "home" | "harness" | "stress"; ... 8 more ...; compressed: Record<...>; }, "file">): string import {to_cell_label} from '@ryanatkn/syntax-highlighter-bench/cell_groups.js';

A cell's row label: its file name. A group holds one source and one language, which is all the rest of the path says, and one directory never holds two files of one name, so the name tells a group's rows apart.

cell

type Pick<BenchCell, "file">

returns

string

to_combined_set_note
#

bundle_matrix.ts view source

(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.

set

returns

string

to_combined_sets
#

bundle_matrix.ts view source

(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.

sets

type readonly BenchSet[]

langs

type readonly BenchLang[]

returns

CombinedSet[]

to_coverage_matrix
#

coverage_matrix.ts view source

(results: Pick<{ meta: { generated_at: string | null; machine: { name: string; cpu: string; threads: number | null; governor: string | null; cpufreq_driver: string | null; epp: string | null; boost: boolean | null; memory_gb: number; os_release: string; } | null; ... 10 more ...; bundler: { ...; } | ... 1 more ... | null; }; ... 8 more ...; coverage: Record<...>; }, "langs" | ... 1 more ... | "coverage">): CoverageMatrix import {to_coverage_matrix} from '@ryanatkn/syntax-highlighter-bench/coverage_matrix.js';

Builds the coverage matrix of a results file. Footnotes are numbered in the order the matrix first uses them, reading by row, and a text shared by two libraries is one footnote.

results

type Pick<BenchResults, "langs" | "meta" | "coverage">

returns

CoverageMatrix

to_default_results_filters
#

results_filters.ts view source

(options: ResultsFilterOptions): ResultsFilters import {to_default_results_filters} from '@ryanatkn/syntax-highlighter-bench/results_filters.js';

The selection a reader starts from: everything, except the sources, where only the neutral inputs are selected, the forms of a cold start, where only the bundled one is, and the parts of a retained heap, where only the sum is. Bundle sizes start gzipped and HTML sizes raw.

options

returns

ResultsFilters

to_docs_data
#

docs_data.ts view source

({ source, results, corpus_current }: SiteResults): DocsData import {to_docs_data} from '@ryanatkn/syntax-highlighter-bench/docs_data.js';

Picks what the docs pages show from the results the site renders.

__0

returns

DocsData

to_excluded_key
#

cell_groups.ts view source

(cell: string, library: string): string import {to_excluded_key} from '@ryanatkn/syntax-highlighter-bench/cell_groups.js';

The key of one library in one cell.

cell

type string

library

type string

returns

string

to_excluded_reasons
#

cell_groups.ts view source

(results: Pick<MatrixResults, "meta">): Map<string, string> import {to_excluded_reasons} from '@ryanatkn/syntax-highlighter-bench/cell_groups.js';

The reason each excluded library has in each cell, by to_excluded_key.

results

type Pick<MatrixResults, "meta">

returns

Map<string, string>

to_geomean
#

ratio.ts view source

(values: readonly number[]): number | null import {to_geomean} from '@ryanatkn/syntax-highlighter-bench/ratio.js';

The geometric mean of positive numbers, or null for none.

values

type readonly number[]

returns

number | null

to_geomean_row
#

matrix.ts view source

(rows: readonly MatrixRow[], libraries: readonly string[], key: string, label: string): MatrixRow | null import {to_geomean_row} from '@ryanatkn/syntax-highlighter-bench/matrix.js';

A summary row holding each library's geometric mean over the rows that are complete for every one of the libraries. A mean over a different set of rows for each library would favor whichever library skipped the slow ones, so a row missing any selected library is left out for all of them, as is a row holding a number that can't be ranked, whose ratios are at best bounds, and the row's note says how many it covers. With no complete row there is no mean, and the row says so in place of its entries.

rows

the cell rows to summarize, sharing a unit and a direction

type readonly MatrixRow[]

libraries

the selected library ids

type readonly string[]

key

type string

label

type string

returns

MatrixRow | null

the summary row, or null when there are no rows to summarize

to_headline_charts
#

headline.ts view source

(results: MatrixResults): HeadlineChart[] import {to_headline_charts} from '@ryanatkn/syntax-highlighter-bench/headline.js';

The headline figures, each drawn as bars: geometric-mean throughput over the neutral inputs for each mode, the time to a first highlight from a cold start, the retained memory over the languages, everything a page loads over the documentation set with what it is made of, and that set's JS alone. Only the throughput rows carry the run's noise floor, which was calibrated on the timed cells. A figure the file holds no number for is left out, so a file with no timed run draws only its deterministic figures.

results

returns

HeadlineChart[]

to_heap_floor
#

heap_matrix.ts view source

(values: readonly number[]): number | null import {to_heap_floor} from '@ryanatkn/syntax-highlighter-bench/heap_matrix.js';

The noise floor of a heap row, as a ratio's deviation: the tolerance two readings are compared within, HEAP_TOLERANCE_KB or HEAP_TOLERANCE_RATIO, whichever is larger, taken against the smallest number in the row.

values

the row's numbers, in bytes

type readonly number[]

returns

number | null

the floor, or null for a row with no positive number

to_heap_groups
#

heap_matrix.ts view source

(results: MatrixResults, selection: { langs: readonly string[]; parts: readonly string[]; }): MatrixGroup[] import {to_heap_groups} from '@ryanatkn/syntax-highlighter-bench/heap_matrix.js';

The selected languages as rows, in the file's order, once for each selected measure. A library that doesn't claim a language is unsupported there, and one that claims it with no reading, as in a run filtered to other libraries, is unmeasured.

results

selection

type { langs: readonly string[]; parts: readonly string[]; }

returns

MatrixGroup[]

the groups, none for a file with no retained heap

to_install_group
#

bundle_matrix.ts view source

(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.

results

returns

MatrixGroup | null

the group, or null for a file that measured no footprint

to_language_weight_groups
#

headline.ts view source

(results: MatrixResults): MatrixGroup[] import {to_language_weight_groups} from '@ryanatkn/syntax-highlighter-bench/headline.js';

What each language's grammar adds to a library's JS: the floor, the library with no language, then each language alone less that floor, every one minified and compressed with HEADLINE_COMPRESSION.

results

returns

MatrixGroup[]

the groups, none for a file that measured no bundle

to_library_color
#

library_labels.ts view source

(index: number): string import {to_library_color} from '@ryanatkn/syntax-highlighter-bench/library_labels.js';

The color of the library at index in the roster, cycling past the last.

index

type number

returns

string

to_matrix_ratios
#

matrix.ts view source

(row: MatrixRow, libraries: readonly string[], reference: string | null): Record<string, number> import {to_matrix_ratios} from '@ryanatkn/syntax-highlighter-bench/matrix.js';

Each library's ratio against the row's baseline: 1 is the baseline, and more is that many times worse. A number that can't be ranked has no ratio, nor has one under the resolution of a row whose ratios are bounds, and a row where fewer than two of the libraries have a number has none at all: there is nothing to compare.

row

libraries

type readonly string[]

reference

type string | null

returns

Record<string, number>

the ratios by library id, for the libraries that have one

to_matrix_row
#

matrix.ts view source

(row: Pick<MatrixRow, "label" | "key" | "unit" | "direction"> & Partial<MatrixRow>): MatrixRow import {to_matrix_row} from '@ryanatkn/syntax-highlighter-bench/matrix.js';

A row with the defaults filled in.

row

type Pick<MatrixRow, "label" | "key" | "unit" | "direction"> & Partial<MatrixRow>

returns

MatrixRow

to_max_compressed_bytes
#

results_schema.ts view source

(raw: number): number import {to_max_compressed_bytes} from '@ryanatkn/syntax-highlighter-bench/results_schema.js';

The most a compressed size may exceed the raw one by: a compression format adds a header and a little framing, so a few bytes of input, or bytes that don't compress, come out slightly larger. Anything past that is a mistake.

raw

type number

returns

number

to_missing_cell_entry
#

cell_groups.ts view source

(results: Pick<MatrixResults, "coverage">, excluded: ReadonlyMap<string, string>, cell: Pick<{ id: string; metric: "throughput"; lang: string; size: "micro" | ... 2 more ... | "large"; ... 10 more ...; compressed: Record<...>; }, "id" | "lang">, library: string): MatrixEntry import {to_missing_cell_entry} from '@ryanatkn/syntax-highlighter-bench/cell_groups.js';

Why a library has no number in a cell: excluded with its reason, unsupported when it doesn't claim the cell's language, and otherwise unmeasured.

results

type Pick<MatrixResults, "coverage">

excluded

type ReadonlyMap<string, string>

cell

type Pick<BenchCell, "id" | "lang">

library

type string

returns

MatrixEntry

to_output_groups
#

output_matrix.ts view source

(results: MatrixResults, selection: OutputSelection): MatrixGroup[] import {to_output_groups} from '@ryanatkn/syntax-highlighter-bench/output_matrix.js';

The selected inputs as groups of one language and one source, with a row for each selected measure of each input. There is no summary row: libraries split the same source differently and wrap their HTML differently, so a smaller count is not a better one.

results

selection

returns

MatrixGroup[]

to_practice_group
#

headline.ts view source

(results: MatrixResults): MatrixGroup | null import {to_practice_group} from '@ryanatkn/syntax-highlighter-bench/headline.js';

The HTML throughput worked out for sizes a reader knows: the time to highlight one block, how many blocks fit in one frame, and the time for a build's worth of source. Each is the geometric-mean rate over the neutral inputs applied to that size, so it is an estimate, and it carries the geomean's noise floor, since every ratio in it is the rate's own.

results

returns

MatrixGroup | null

the group, or null for a file with no timed throughput

to_provenance_url
#

corpus_inputs.ts view source

(provenance: Pick<{ repo: string; commit: string; path: string; sha256: string; license: string; note: string | null; }, "commit" | "path" | "repo">): string import {to_provenance_url} from '@ryanatkn/syntax-highlighter-bench/corpus_inputs.js';

The page of an upstream file at its pinned commit.

provenance

type Pick<BenchProvenance, "commit" | "path" | "repo">

returns

string

to_ratio
#

ratio.ts view source

(value: number, baseline: number, direction: RatioDirection): number | null import {to_ratio} from '@ryanatkn/syntax-highlighter-bench/ratio.js';

How many times worse value is than baseline.

value

type number

baseline

type number

direction

returns

number | null

the ratio, or null when either number isn't positive and finite, so a ratio is never made from a zero

to_ratio_color
#

ratio.ts view source

(ratio: number): string import {to_ratio_color} from '@ryanatkn/syntax-highlighter-bench/ratio.js';

The color of a ratio. The tables tint a cell with it and always print the ratio too.

ratio

type number

returns

string

to_ratio_display_color
#

ratio.ts view source

(ratio: number, bound: boolean): string import {to_ratio_display_color} from '@ryanatkn/syntax-highlighter-bench/ratio.js';

The color of a ratio as shown: a lower bound's when bound, the scale's otherwise. Every table cell, table bar, and chart ratio is colored through it.

ratio

type number

bound

type boolean

returns

string

to_ratio_legend
#

ratio.ts view source

(): RatioLegendEntry[] import {to_ratio_legend} from '@ryanatkn/syntax-highlighter-bench/ratio.js';

The color scale as a key, level by level, from the limits it is drawn from, so the key can't disagree with the cells.

returns

RatioLegendEntry[]

to_ratio_level
#

ratio.ts view source

(ratio: number): number import {to_ratio_level} from '@ryanatkn/syntax-highlighter-bench/ratio.js';

The level of the color scale a ratio falls in, from 0 (better than the reference) to the last index of RATIO_LEVEL_COLORS. It never decreases as the ratio grows.

ratio

type number

returns

number

to_results_filter_options
#

to_selected_libraries
#

results_filters.ts view source

(libraries: readonly { id: string; label: string; package: string; version: string; output: "classes" | "inline_styles"; engine: "scanner" | "grammar_vm" | "regex" | "textmate"; by_maintainer: boolean; note: string | null; theme_schemes: ("light" | "dark")[]; extra_packages?: Record<...> | undefined; }[], filters: Pick<...>): { ...; }[] import {to_selected_libraries} from '@ryanatkn/syntax-highlighter-bench/results_filters.js';

The libraries a selection shows, in roster order: the selected ones whose engine kind and output shape are selected too.

libraries

type readonly BenchLibrary[]

filters

type Pick<ResultsFilters, "libraries" | "engines" | "outputs">

returns

BenchLibrary[]

to_selected_reference
#

results_filters.ts view source

(selected: readonly { id: string; label: string; package: string; version: string; output: "classes" | "inline_styles"; engine: "scanner" | "grammar_vm" | "regex" | "textmate"; by_maintainer: boolean; note: string | null; theme_schemes: ("light" | "dark")[]; extra_packages?: Record<...> | undefined; }[], filters: Pick<...>): string | null import {to_selected_reference} from '@ryanatkn/syntax-highlighter-bench/results_filters.js';

The reference library a selection's ratios are taken against, or null for the best in each row: a reference that isn't among the libraries shown is ignored.

selected

type readonly BenchLibrary[]

filters

type Pick<ResultsFilters, "reference">

returns

string | null

to_source_key
#

cell_groups.ts view source

(input: Pick<{ id: string; metric: "throughput"; lang: string; size: "micro" | "small" | "medium" | "large"; mode: "tokenize" | "html"; source: "neutral" | "shiki" | "home" | "harness" | "stress"; ... 8 more ...; compressed: Record<...>; }, "home" | "source">): string import {to_source_key} from '@ryanatkn/syntax-highlighter-bench/cell_groups.js';

The key of an input's source on the site: the source, with the owner appended for a home input, as home:<library>.

input

type Pick<BenchCell, "home" | "source">

returns

string

to_source_keys
#

cell_groups.ts view source

(cells: readonly Pick<{ id: string; metric: "throughput"; lang: string; size: "micro" | "small" | "medium" | "large"; mode: "tokenize" | "html"; source: "neutral" | "shiki" | "home" | "harness" | "stress"; ... 8 more ...; compressed: Record<...>; }, "home" | "source">[]): string[] import {to_source_keys} from '@ryanatkn/syntax-highlighter-bench/cell_groups.js';

The source keys of a file's cells, in the order of BENCH_SOURCES, then by owner.

cells

type readonly Pick<BenchCell, "home" | "source">[]

returns

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

to_throughput_badges
#

throughput_matrix.ts view source

(value: { ns_per_op: number; ops_per_sec: number; mb_per_sec: number; p10_ns: number; p90_ns: number; spread: number; pass_medians_ns: number[]; iterations: number; rss_peak_bytes: number; attempts: number; }): MatrixBadge[] import {to_throughput_badges} from '@ryanatkn/syntax-highlighter-bench/throughput_matrix.js';

The marks on a value whose rounds disagreed or that was measured again.

value

returns

MatrixBadge[]

to_throughput_details
#

throughput_matrix.ts view source

(value: { ns_per_op: number; ops_per_sec: number; mb_per_sec: number; p10_ns: number; p90_ns: number; spread: number; pass_medians_ns: number[]; iterations: number; rss_peak_bytes: number; attempts: number; }): string[] import {to_throughput_details} from '@ryanatkn/syntax-highlighter-bench/throughput_matrix.js';

Everything a cell value records, as lines for the detail view.

value

returns

string[]

to_throughput_groups
#

throughput_matrix.ts view source

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

The selected cells as groups of one language and one source. Within a group each selected mode's cells follow a geometric mean over them, so the means read as the group's summary and the cells as what they summarize.

results

selection

libraries

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

type readonly string[]

returns

MatrixGroup[]

to_throughput_summary
#

throughput_matrix.ts view source

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

The geometric means across every selected language: one row for each source and mode. Sources are never pooled, so a mean over home inputs always names the library whose samples they are.

results

selection

libraries

type readonly string[]

returns

MatrixGroup

to_value_entry
#

matrix.ts view source

(value: number, options?: Partial<Omit<MatrixValue, "value" | "kind">>): MatrixValue import {to_value_entry} from '@ryanatkn/syntax-highlighter-bench/matrix.js';

An entry holding a number.

value

type number

options

type Partial<Omit<MatrixValue, "value" | "kind">>
default {}

returns

MatrixValue