headline.ts

The headline figures of the landing page, each drawn as bars, and the table of what each language costs in a bundle: read from a results file by the same functions the results page uses.

view source

Declarations
#

8 declarations

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

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.

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

Depends on
#