heap_matrix.ts

The retained-heap tables: what each library holds once one language is loaded and highlighted once, as a row for each language. A file states three numbers for each (BenchHeap): the V8 heap less machine code, the machine code, where compiled regular expressions live, and the external memory beside it, where a WebAssembly engine keeps its linear memory. Four groups show them: the three summed, which is what a consumer pays and so is ranked first, then each on its own.

view source

Declarations
#

6 declarations

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.

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.

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.

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

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

Depends on
#

Imported by
#