cell_groups.ts

Groups the cells of a results file for display: by language, then by where the input came from, then by size and mode. A home input is grouped by the library whose samples it is, never pooled with another library's, so a summary over a group can't hide whose home turf it was measured on.

view source

Declarations
#

12 declarations

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

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

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

Depends on
#

Imported by
#