syntax-highlighter-bench results

Timed on laptop1 (AMD Ryzen 5 PRO 7530U with Radeon Graphics, Node v24.14.1) on 2026-10-12 at commit 340492a991. The machine's noise floor is 2.4% for one cell and 0.1% for a geometric mean: a smaller difference is not a result. The method says how each number is measured and what it leaves out.

The machine and the run

laptop1: AMD Ryzen 5 PRO 7530U with Radeon Graphics, 12 threads, performance governor, amd-pstate-epp driver, energy preference performance, boost on, 14.4 GB, kernel 6.12.90+deb13.1-amd64. Corpus e649d70d43. The anchor, a fixed workload read before and after measuring, drifted 1.1%: stable. Two processes measuring the same library on the same cell in this run were 4.0% apart at the 95th percentile and 0.9% at the median, against 4.0% at the 95th percentile in the calibration.

These numbers are the run's own, a snapshot of what it measured. Since then: fuz_code was measured at 0.52.1 and is now at 0.56.0.

Each row is one thing measured, with a column for each library. Beside a number is its ratio to the best in the row, or to a reference library you choose: 1.00× is the baseline and 2.00× is twice as slow or twice as large. In the tables whose ratios aren't colored, where a smaller number isn't a better one, the baseline is the smallest. A library with no number in a row says why: unsupported when its adapter doesn't claim the language, and excluded when it claims it and its output failed the check that runs before measuring. Neither is a zero, and neither enters a mean.

Compare

The selection is kept in the address, so a comparison is a link.

Libraries
Languages
Input sources

A home source is a library's own samples: home turf for that library, and always labeled with its name. Home inputs are summarized by owner and never pooled. The corpus docs list every input.

More filters
Sections
Engine kind
HTML output
Input sizes
Modes

Throughput

Cell tint, by ratio to the baseline:
  • under 0.9×, better than the reference
  • 0.9–1.1×, level
  • 1.1–2×
  • 2–5×
  • 5–10×
  • 10–100×
  • 100× or more

A warm library on one input, in one mode. Each language shows a geometric mean per mode; open it for the rows the mean is over, one for each input in each mode.

How to read this table

MB/s compares across inputs of different sizes, and time per call does not: inputs in one size tier can differ several times over in bytes. A geometric mean covers only the rows where every selected library has a number, and says how many. A disturbed mark is a value whose rounds disagreed, and retried one that was measured again. A ratio marked ≈ is inside the machine's noise floor.

inputTwinkleplop Prism Shiki (JS engine) Shiki (wasm) fuz_codemaintainer's
Every selected language
geomean · neutral · tokenize over 27 of 27 rows 63.4 MB/s 3.68× 14.8 MB/s 15.7× 1.57 MB/s 148× 1.15 MB/s 202× 233 MB/s 1.00×
geomean · neutral · html over 27 of 27 rows 34.8 MB/s 1.97× 7.91 MB/s 8.69× 1.04 MB/s 66.1× 0.86 MB/s 79.7× 68.8 MB/s 1.00×
TypeScript · neutral real code no measured library authored
geomean · tokenize over 3 of 3 rows 27.7 MB/s 5.89× 6.46 MB/s 25.3× 0.58 MB/s 283× 0.73 MB/s 223× 163 MB/s 1.00×
geomean · html over 3 of 3 rows 19.5 MB/s 2.93× 4.75 MB/s 12.0× 0.50 MB/s 115× 0.63 MB/s 91.1× 57.0 MB/s 1.00×
JS · neutral real code no measured library authored
geomean · tokenize over 3 of 3 rows 31.6 MB/s 5.66× 10.7 MB/s 16.7× 0.47 MB/s 377× 0.68 MB/s 261× 179 MB/s 1.00×
geomean · html over 3 of 3 rows 21.4 MB/s 2.76× 6.76 MB/s 8.73× 0.42 MB/s 142× 0.57 MB/s 103× 59.1 MB/s 1.00×
CSS · neutral real code no measured library authored
geomean · tokenize over 3 of 3 rows 58.5 MB/s 3.71× 31.3 MB/s 6.95× 2.09 MB/s 104× 0.41 MB/s 528× 217 MB/s 1.00×
geomean · html over 3 of 3 rows 35.0 MB/s 1.99× 10.6 MB/s 6.56× 1.19 MB/s 58.8× 0.35 MB/s 202× 69.8 MB/s 1.00×
HTML · neutral real code no measured library authored
geomean · tokenize over 3 of 3 rows 72.2 MB/s 3.07× 15.9 MB/s 13.9× 1.03 MB/s 215× 0.92 MB/s 242× 221 MB/s 1.00×
geomean · html over 3 of 3 rows 31.8 MB/s 1.39× 6.61 MB/s 6.71× 0.74 MB/s 59.6× 0.69 MB/s 64.2× 44.4 MB/s 1.00×
JSON · neutral real code no measured library authored
geomean · tokenize over 3 of 3 rows 192 MB/s 1.99× 48.9 MB/s 7.83× 6.40 MB/s 59.8× 4.54 MB/s 84.4× 383 MB/s 1.00×
geomean · html over 3 of 3 rows 64.8 MB/s 1.44× 15.4 MB/s 6.05× 2.85 MB/s 32.8× 2.38 MB/s 39.2× 93.3 MB/s 1.00×
Svelte · neutral real code no measured library authored
geomean · tokenize over 3 of 3 rows 24.1 MB/s 4.89× 8.81 MB/s 13.4× 0.30 MB/s 394× 0.39 MB/s 304× 118 MB/s 1.00×
geomean · html over 3 of 3 rows 17.2 MB/s 2.44× 5.27 MB/s 7.95× 0.27 MB/s 154× 0.34 MB/s 123× 41.9 MB/s 1.00×
Markdown · neutral real code no measured library authored
geomean · tokenize over 3 of 3 rows 161 MB/s 2.19× 10.6 MB/s 33.4× 11.4 MB/s 31.1× 5.82 MB/s 60.8× 354 MB/s 1.00×
geomean · html over 3 of 3 rows 83.4 MB/s 1.51× 9.48 MB/s 13.3× 5.08 MB/s 24.8× 3.54 MB/s 35.5× 126 MB/s 1.00×
Bash · neutral real code no measured library authored
geomean · tokenize over 3 of 3 rows 76.7 MB/s 3.81× 8.11 MB/s 36.0× 1.74 MB/s 168× 1.37 MB/s 214× 292 MB/s 1.00×
geomean · html over 3 of 3 rows 42.4 MB/s 2.17× 5.74 MB/s 16.0× 1.24 MB/s 73.9× 1.05 MB/s 88.0× 92.0 MB/s 1.00×
Rust · neutral real code no measured library authored
geomean · tokenize over 3 of 3 rows 78.2 MB/s 3.98× 27.3 MB/s 11.4× 2.63 MB/s 118× 1.37 MB/s 228× 311 MB/s 1.00×
geomean · html over 3 of 3 rows 41.5 MB/s 1.77× 12.2 MB/s 6.01× 1.60 MB/s 45.7× 1.03 MB/s 71.2× 73.3 MB/s 1.00×

Cold start

Loaded as

What each library adds to a fresh Node process: the scenario's median time less bare Node's. A row's details give the whole time and the process's peak memory.

How to read this table

Bundled is the one chunk whose size is reported below, and unbundled imports the same entry with its imports resolved from node_modules. A ratio between small additions is large even when the processes take nearly the same time.

An addition is one median less another, so it is held against how far such a difference can be off: bare Node's own band, from its 10th to its 90th percentile, scaled down for medians of many samples. A smaller addition is marked in the noise: it can't be told from adding nothing, and has no ratio. In a row with such an addition the others are compared with that margin instead of with the best, and marked ≥: at least so many times the margin, and so at least so many times the best, which is inside it. Such a row is left out of the mean. A reference library is used only in the rows where its own addition is outside the noise.

loadedTwinkleplop Prism Shiki (JS engine) Shiki (wasm) fuz_codemaintainer's
bundled · import the library with no language
core 2.07 ms ≥2.47× 0.83 ms in the noise 10.6 ms ≥12.7× 50.7 ms ≥60.6× 0.60 ms in the noise
bundled · import the library with one language
geomean over 7 of 9 rows: the others lack an exact number for a library and are left out 10.5 ms 7.16× 2.00 ms 1.36× 15.6 ms 10.7× 54.8 ms 37.4× 1.46 ms 1.00×
bundled · import the library with a feature set
docs 19.7 ms 7.16× 4.23 ms 1.54× 33.6 ms 12.2× 72.5 ms 26.4× 2.75 ms 1.00×
bundled · import one language and highlight once
geomean over 9 of 9 rows 11.2 ms 4.69× 6.20 ms 2.59× 114 ms 47.6× 125 ms 52.2× 2.39 ms 1.00×

Bundle size

What each language costs in a library's minified JS: the floor with no language, each language over it, and one more beside the others.

How to read this table

Each language is the bundle with that language alone, less the bundle with none. One more language is what it adds to a bundle of every other timed language, always in minified bytes, whatever the Bytes selector says: compressing a whole bundle doesn't separate one part of it. An addition too small to be a grammar, or none, shows as already included, and a language every library already includes has no row. The floor plus each language alone is not a bundle, so it has no ratio: it exceeds the set's measured size when a library shares code between languages, or when one language brings another with it, as HTML brings the script and style languages. The wasm binary and the theme stylesheet are loaded beside the JS, and each has a row of its own.

languageTwinkleplop Prism Shiki (JS engine) Shiki (wasm) fuz_codemaintainer's
The floor the library with no language, minified and gzipped
core 18.7 kB 14.3× 3.56 kB 2.71× 56.6 kB 43.1× 38.9 kB 29.6× 1.31 kB 1.00×
Each language its bundle less the floor, minified and gzipped: with any runtime the floor leaves out
TypeScript 28.8 kB 13.5× 2.13 kB 1.00× 15.7 kB 7.35× 15.7 kB 7.37× 4.80 kB 2.26×
JS 25.8 kB 14.4× 1.79 kB 1.00× 16.1 kB 9.00× 16.1 kB 9.00× 4.80 kB 2.68×
CSS 11.0 kB 20.0× 552 B 1.00× 12.3 kB 22.4× 12.4 kB 22.4× 1.19 kB 2.15×
HTML 25.8 kB 8.49× 3.04 kB 1.00× 39.4 kB 13.0× 39.6 kB 13.0× 7.76 kB 2.56×
XML — unsupported: no xml949 B 1.00× 4.95 kB 5.21× 4.97 kB 5.24× 2.34 kB 2.47×
JSON 606 B 2.85× 213 B 1.00× 611 B 2.87× 613 B 2.88× 695 B 3.26×
Svelte 26.8 kB 7.90× 3.40 kB 1.00× 47.2 kB 13.9× 47.1 kB 13.9× 8.44 kB 2.48×
Markdown 3.67 kB 1.38× 2.65 kB 1.00× 5.56 kB 2.09× 5.57 kB 2.10× 3.68 kB 1.39×
Bash 12.8 kB 4.22× 3.04 kB 1.00× 5.91 kB 1.94× 5.93 kB 1.95× 3.36 kB 1.11×
Rust 13.2 kB 11.9× 1.11 kB 1.00× 2.57 kB 2.31× 2.58 kB 2.32× 2.58 kB 2.32×
One more language what it adds to a bundle of every other timed language, minified and never compressed, whatever the Bytes selector says: already included when another language embeds it, as HTML and Svelte embed their script and style languages
TypeScript 12.1 kB 9.34× 1.29 kB 1.00× already includedalready includedalready included
HTML already includedalready included57.6 kB 1.00× 57.6 kB 1.00× already included
JSON 1.04 kB 2.31× 449 B 1.00× 2.80 kB 6.23× 2.80 kB 6.23× 1.39 kB 3.09×
Svelte 5.01 kB 2.10× 2.55 kB 1.07× 24.5 kB 10.3× 24.5 kB 10.3× 2.39 kB 1.00×
Markdown 8.36 kB 1.91× 5.24 kB 1.19× 59.3 kB 13.5× 59.3 kB 13.5× 4.38 kB 1.00×
Bash 7.71 kB 1.25× 6.14 kB 1.00× 41.5 kB 6.75× 41.5 kB 6.75× 8.09 kB 1.32×
Rust 9.24 kB 3.72× 2.49 kB 1.00× 15.1 kB 6.09× 15.1 kB 6.09× 6.29 kB 2.53×
Set: docs js, ts, css, html, md, bash, json
floor plus each language alone the floor plus each language alone: not a bundle 127 kB 17.0 kB 152 kB 135 kB 27.6 kB
measured one bundle of them all 53.0 kB 4.60× 11.5 kB 1.00× 123 kB 10.7× 105 kB 9.11× 13.4 kB 1.16×
Loaded beside the JS each on its own
wasm binary nonenonenone159 kB none
theme stylesheet 2.13 kB 3.30× 657 B 1.02× inline styles: the theme is in the JSinline styles: the theme is in the JS643 B 1.00×
color schemes the theme covers light + darklightlightlightlight + dark

Install footprint

What npm install of each library adds to a project: its packages and their runtime dependencies, each package once, with the files they hold and those files' bytes.

How to read this table

It is everything the packages ship, every language, theme, and type declaration included, and not what a page loads, which the tables above show. The ratios are to the smallest and are not colored: a library that ships more languages installs more, and installs it once.

measureTwinkleplop Prism Shiki (JS engine) Shiki (wasm) fuz_codemaintainer's
Install footprint the packages and their runtime dependencies, each package once
packages 11 5.50× 2 1.00× 45 22.5× 45 22.5× 6 3.00×
files 57 1.00× 706 12.4× 2,422 42.5× 2,422 42.5× 391 6.86×
bytes 711 kB 1.00× 2.06 MB 2.89× 15.0 MB 21.0× 15.0 MB 21.0× 2.16 MB 3.03×

Retained heap

Parts

What a process holds once a library has loaded one language and highlighted a small snippet once, over a bare process: a smaller figure is less memory for the same highlight.

How to read this table

A Node process imports the library's bundle of that language alone, the one whose size is reported above, highlights the language's snippet, lets go of the HTML, and collects garbage until the heap settles. Larger inputs leave more, most of all for regexp and wasm engines.

Machine code holds the regular expressions the engine compiled as well as optimized functions, and is the processor's: these figures are x64's. External memory is where a WebAssembly engine keeps its linear memory, counted at the size it has grown to, which it never gives back; the OS backs only the pages it has touched, so resident memory can be lower. The sum of the three is shown first and ranked, so neither a regexp engine nor a wasm engine is compared without what it holds; the Parts filter shows each on its own. A ratio within the heap check's tolerance is marked ≈.

A theme in a stylesheet is held by the page, not the library, so a library that writes its styles inline holds its theme here and one with classes doesn't. The figures are for one Node version; the deterministic metrics docs say which, and what moves them.

languageTwinkleplop Prism Shiki (JS engine) Shiki (wasm) fuz_codemaintainer's
Everything held the V8 heap, its machine code, and the external memory, summed
TypeScript 2.77 MB 13.2× 349 kB 1.66× 7.15 MB 34.1× 46.2 MB 220× 210 kB 1.00×
JS 2.10 MB 10.5× 333 kB 1.68× 5.79 MB 29.1× 33.4 MB 168× 199 kB 1.00×
CSS 828 kB 8.99× 122 kB 1.32× 3.06 MB 33.2× 23.7 MB 257× 92.2 kB 1.00×
HTML 2.00 MB 7.10× 457 kB 1.62× 7.57 MB 26.9× 25.9 MB 92.1× 282 kB 1.00×
JSON 609 kB 8.26× 100 kB 1.36× 1.67 MB 22.7× 19.9 MB 269× 73.7 kB 1.00×
Svelte 2.28 MB 7.20× 479 kB 1.51× 9.95 MB 31.4× 57.0 MB 180× 316 kB 1.00×
Markdown 812 kB 6.40× 349 kB 2.75× 3.40 MB 26.8× 20.9 MB 164× 127 kB 1.00×
Bash 1.22 MB 8.40× 728 kB 5.01× 2.65 MB 18.2× 20.2 MB 139× 145 kB 1.00×
Rust 989 kB 7.49× 193 kB 1.46× 2.18 MB 16.5× 20.0 MB 151× 132 kB 1.00×

Tokens and output

Numbers

How many tokens each library finds in an input, and how large its HTML is: in elements, and in bytes, raw or compressed as a server would send it. Open a language for its inputs.

How to read this table

The ratios are to the smallest in each row and are not colored, because smaller is not better here: libraries split the same source differently and wrap their HTML differently, so fewer tokens is a coarser split, not a better one, and HTML with inline styles carries its theme where HTML with classes leaves it to a stylesheet. The deterministic metrics docs say what each counts.

inputTwinkleplop Prism Shiki (JS engine) Shiki (wasm) fuz_codemaintainer's
TypeScript · neutral real code no measured library authored
JS · neutral real code no measured library authored
CSS · neutral real code no measured library authored
HTML · neutral real code no measured library authored
JSON · neutral real code no measured library authored
Svelte · neutral real code no measured library authored
Markdown · neutral real code no measured library authored
Bash · neutral real code no measured library authored
Rust · neutral real code no measured library authored