Benchmarks
Estimated reading time: 2 minutesKita Html is a string builder. Its performance is measured by rendering the same component tree with each library and comparing time and memory.
Results
Benchmarked on a 13th Gen Intel Core i5-13600K (~4.80 GHz) running Node.js v24.13.0 on
2026-02-23. Run pnpm bench in the repository root to reproduce.
RealWorldPage (170.5 KiB output)
Libraries marked "different output" produce HTML that differs from React's output for the same input. Libraries marked "template engine" use tagged template literals instead of JSX and produce larger output for the same logical content.
Methodology
The RealWorldPage benchmark is the most meaningful because it renders a full component
tree. Template engines such as Ghtml and HonoHtml are faster because they concatenate
template strings without a function call per element. In exchange, element and attribute
names are not type-checked, and the kita-html check XSS diagnostics do not apply to
them. Every JSX library pays one function call per element, so the JSX rows compare like
with like.
Implementation details
The performance comes from building strings directly. The runtime uses
character-by-character loops for HTML escaping instead of regex replacements, checks
before converting (regex test before expensive operations), and orders void element checks
by frequency. When running on Bun, the runtime delegates escaping to Bun's native
escapeHTML implementation.