Benchmarks
Categoryvs harfbuzzjsvs opentype.jsvs freetype2
Path Extraction50x faster19x faster-
SVG Generation26x faster118x faster-
Latin Shaping1.5x faster13x faster-
Cyrillic Shaping1.2x faster20-30x faster-
CJK Shaping1.3x faster10-12x faster-
Arabic Shaping1.0x67x faster-
Hebrew Shaping1.2x faster19x faster-
Hindi Shaping3.3x faster9.0x faster-
Thai Shaping1.6x faster11x faster-
Myanmar Shaping11x faster16x faster-
Khmer Shaping2.2x faster7.7x faster-
UI Simulation6.2x faster--
Rasterization--1.5-10x faster
Cache Benefits--2x speedup on repeated shaping
MacBook Pro M1 Pro16 GBBun 1.3.4text-shaper 0.1.4
Glyph Paths
50x faster than HarfBuzz, 19x faster than opentype.js for path extraction.Extract 10 glyph paths
text-shaper
opentype.js
harfbuzzjs
SVG path generation (10 glyphs)
text-shaper
harfbuzzjs
opentype.js
Text to SVG
Full text-to-SVG pipeline including shaping and path generation. 5.3-7.1x faster than HarfBuzz, 21-30x faster than opentype.js.
Hello World
text-shaper
harfbuzzjs
opentype.js
Paragraph (87 chars)
text-shaper
harfbuzzjs
opentype.js
Text Shaping
Basic Shaping
No features - mixed text
harfbuzzjs
text-shaper
All common features (liga + kern + calt)
text-shaper
harfbuzzjs
Standard ligatures - mixed text
text-shaper
harfbuzzjs
Cyrillic Scripts
1.2x faster than HarfBuzz across Russian, Ukrainian, and Belarusian. 20-30x faster than opentype.js.Russian paragraph (1001 chars)
text-shaper
harfbuzzjs
opentype.js
Ukrainian paragraph (788 chars)
text-shaper
harfbuzzjs
opentype.js
Belarusian paragraph (712 chars)
text-shaper
harfbuzzjs
opentype.js
CJK Scripts
1.3x faster than HarfBuzz for CJK text, 10-12x faster than opentype.js.Chinese Simplified (329 chars)
text-shaper
harfbuzzjs
opentype.js
Japanese (418 chars)
text-shaper
harfbuzzjs
opentype.js
Korean (449 chars)
text-shaper
harfbuzzjs
opentype.js
Latin Scripts
1.5x faster than HarfBuzz, 13x faster than opentype.js for Latin text.English paragraph (1056 chars)
text-shaper
harfbuzzjs
opentype.js
RTL Scripts
1-1.2x faster than HarfBuzz for Arabic and Hebrew. 19-67x faster than opentype.js.Arabic paragraph (1121 chars)
text-shaper
harfbuzzjs
opentype.js
Hebrew paragraph (1220 chars)
text-shaper
harfbuzzjs
opentype.js
Complex Scripts
TextShaper matches HarfBuzz on Indic and Southeast Asian scripts, 7.7-16x faster than opentype.js.
Hindi paragraph (1105 chars)
text-shaper
harfbuzzjs
opentype.js
Myanmar paragraph (984 chars)
text-shaper
harfbuzzjs
opentype.js
Khmer paragraph (1004 chars)
text-shaper
harfbuzzjs
opentype.js
Thai paragraph (832 chars)
text-shaper
harfbuzzjs
opentype.js
Greek
1.2x faster than HarfBuzz, 27x faster than opentype.js for Greek text.Greek paragraph (997 chars)
text-shaper
harfbuzzjs
opentype.js
Caching Performance
Shape plan caching provides significant speedups for repeated shaping.
Repeated Shaping - Hello
text-shaper
harfbuzzjs
(first call)
Repeated Shaping - paragraph (85 chars)
text-shaper
(first call)
harfbuzzjs
Glyph Path Cache
text-shaper
(first call)
Real-World Simulations
UI Simulation - 8 labels with paths
text-shaper
harfbuzzjs
Document Simulation - 4 paragraphs
text-shaper
harfbuzzjs
Rasterization
Compared against FreeType2 (WebAssembly). TextShaper is 1.5-10x faster than FreeType2 at all sizes.
12px grayscale (5 glyphs)
text-shaper
freetype2
24px grayscale (5 glyphs)
text-shaper
freetype2
48px grayscale (5 glyphs)
text-shaper
freetype2
96px grayscale (5 glyphs)
text-shaper
freetype2
200px grayscale (5 glyphs)
text-shaper
freetype2
Render Modes
LCD subpixel (24px)
text-shaper
freetype2
Hinted (12px)
text-shaper
freetype2
Throughput
62 glyphs at 16px
text-shaper
freetype2
Varying sizes - 15 sizes per iteration
text-shaper
freetype2
Very large - 5 glyphs at 200px
text-shaper
freetype2
OpenType Features
No features - mixed text
harfbuzzjs
text-shaper
Standard ligatures (liga)
text-shaper
harfbuzzjs
Kerning pairs
text-shaper
harfbuzzjs
Small caps (smcp)
text-shaper
harfbuzzjs
Oldstyle figures (onum)
text-shaper
harfbuzzjs
Tabular figures (tnum)
text-shaper
harfbuzzjs
Fractions (frac)
text-shaper
harfbuzzjs
All common features (liga + kern + calt)
text-shaper
harfbuzzjs
Grapheme Clusters
0.4-3.8x vs Intl.Segmenter, 2-9.5x faster than graphemer.Count graphemes - ASCII (11 chars)
intlSegmenter
text-shaper
graphemer
Count graphemes - emoji simple (5 graphemes)
text-shaper
intlSegmenter
graphemer
Count graphemes - emoji ZWJ (8 graphemes)
intlSegmenter
text-shaper
graphemer
Count graphemes - Devanagari (8 graphemes)
text-shaper
intlSegmenter
graphemer
Count graphemes - mixed (25 graphemes)
intlSegmenter
text-shaper
graphemer
Split graphemes - emoji ZWJ (8 graphemes)
text-shaper
intlSegmenter
graphemer