Complete themed tokens
Complete themed token generation reaches 208 MiB/s · 173× Shiki’s throughput on the 517 KiB TypeScript fixture.
@pierre/highlights is a super-fast, lightweight syntax highlighter hand-written in WebAssembly Text. Built especially for @pierre/diffs. Includes built-in language lexers, runs across JavaScript runtimes, and supports Shiki-compatible formats. Generates large-file HTML up to 294× faster than Shiki.
Highlights generates HTML at hundreds of times Shiki’s throughput on large files, with substantially lower peak process memory.
148–294× Shiki’s throughput across these fixtures. On the 517 KiB TypeScript input, Tree-sitter reaches ≈8× Shiki.
Median peak process RSS while generating HTML from the 517 KiB TypeScript fixture, shown on a shared 0–400 MiB scale. Lower is better.
Complete themed token generation reaches 208 MiB/s · 173× Shiki’s throughput on the 517 KiB TypeScript fixture.
Streaming themed token generation reaches 197 MiB/s · 170× Shiki’s throughput on a large TypeScript fixture.
For single-character edits and line insertion or deletion on the TypeScript fixture (517 KiB), the median synchronous response is under 1.4 µs, excluding deferred tokenization.
Measured September 25, 2026 on an Apple M4 Pro (14 cores, 48 GiB RAM) using Bun 1.4.0, Shiki 4.4.1, and tree-sitter-highlight 1.1.2. Median throughput after warmup. Memory measured September 16, 2026 as median peak process RSS from five fresh processes per engine. RSS includes the runtime, compiled code, Wasm, and allocator capacity; it is not live heap or bundle size. Results vary by input and environment. Explore the benchmarks and methodology.
Throughput is relative to Shiki’s 1× baseline; higher is better. Each chart uses its own shared zero-based linear scale.
Highlights ships its language lexers in one small WebAssembly module. No grammar downloads or language registration. Pick a language and edit the example below to try it yourself.
Native WebAssembly performance, Shiki-compatible output, and incremental tokenization built for editors.
codeToHtml() returns a view into WebAssembly memory, ready for a response, file, or decoder.codeToHtml() and codeToTokens() in familiar highlighting workflows.themes to render light and dark in one pass, with Shiki's CSS custom properties or light-dark() colors.StreamTokenizer emits completed lines of themed tokens as code arrives, preserving lexer state across chunks.LiveTokenizer re-tokenizes only lines whose text or lexer state changed.Install @pierre/highlights, then follow the documentation to render HTML, stream tokens, or add live highlighting to an editor.
Collectively, our team brings over 150 years of expertise designing, building, and scaling the world's largest distributed systems at Cloudflare, Coinbase, Discord, GitHub, Reddit, Stripe, X, and others.