clk: ~4.80 GHz
cpu: 13th Gen Intel(R) Core(TM) i5-13600K
runtime: node 24.13.0 (x64-linux)
benchmark avg (min β¦ max) p75 / p99 (min β¦ top 1%)
------------------------------------------- -------------------------------
KitaJs 170.5 KiB 361.79 Β΅s/iter 358.24 Β΅s β
(302.91 Β΅s β¦ 1.13 ms) 866.76 Β΅s ββ
( 1.27 mb β¦ 2.53 mb) 1.83 mb ββββ
βββββββββββββββββ
! TypedHtml 173.5 KiB 2.11 ms/iter 2.24 ms β
β β
(1.78 ms β¦ 3.47 ms) 2.97 ms βββββ
( 6.24 mb β¦ 8.48 mb) 7.13 mb βββββββββ
β
βββ
ββββββββ
! vHtml 170.5 KiB 2.06 ms/iter 2.18 ms ββ
(1.79 ms β¦ 3.24 ms) 3.19 ms ββββ
β
( 2.31 mb β¦ 4.63 mb) 3.54 mb βββββββββ
ββββββββββββ
ReactJsx 170.5 KiB 1.01 ms/iter 1.08 ms β
(822.95 Β΅s β¦ 2.33 ms) 1.92 ms βββ
( 1.31 mb β¦ 4.67 mb) 3.30 mb βββββββ
ββββββββββββββ
Preact 170.5 KiB 806.05 Β΅s/iter 845.81 Β΅s β
(603.80 Β΅s β¦ 4.66 ms) 3.13 ms βββ
( 2.32 mb β¦ 4.42 mb) 3.09 mb βββββββββββββββββββββ
React 170.5 KiB 1.04 ms/iter 1.03 ms β
(919.83 Β΅s β¦ 2.15 ms) 1.86 ms βββ
( 2.14 mb β¦ 5.16 mb) 3.68 mb ββββ
βββββββββββββββββ
! Jsxte 170.6 KiB 3.95 ms/iter 4.19 ms β
(3.59 ms β¦ 5.20 ms) 4.89 ms βββββ
( 13.36 mb β¦ 17.30 mb) 13.94 mb ββββββββββββ
βββ
ββββββ
HonoJsx 170.5 KiB 1.05 ms/iter 1.07 ms β
β
(872.65 Β΅s β¦ 2.60 ms) 1.95 ms βββ
( 2.46 mb β¦ 6.24 mb) 3.14 mb βββββ
ββββββββββββββββ
* CommonTags 211.3 KiB 3.58 ms/iter 3.60 ms β
(3.18 ms β¦ 5.39 ms) 5.17 ms ββ
( 5.55 mb β¦ 7.45 mb) 6.30 mb βββββββββββββββββββββ
* Ghtml 204.5 KiB 230.79 Β΅s/iter 216.96 Β΅s β
(188.45 Β΅s β¦ 3.27 ms) 440.05 Β΅s ββ
(169.75 kb β¦ 1.38 mb) 649.87 kb ββββ
βββββββββββββββββ
* HonoHtml 204.5 KiB 118.12 Β΅s/iter 113.55 Β΅s β
(103.38 Β΅s β¦ 645.95 Β΅s) 360.09 Β΅s β
( 40.68 kb β¦ 1.11 mb) 549.60 kb βββ
ββββββββββββββββββ
β β
β¬ β·
KitaJs 170.5 KiB ββββββ€
β΄ β΅
β·βββ¬β β·
! TypedHtml 173.5 KiB ββ€ ββββββββ€
β΅βββ΄β β΅
β·ββ¬β β·
! vHtml 170.5 KiB ββ€βββββββββββ€
β΅ββ΄β β΅
β·ββ¬β β·
ReactJsx 170.5 KiB ββ€βββββββββ€
β΅ββ΄β β΅
β·ββ¬β β·
Preact 170.5 KiB ββ€ββββββββββββββββββββββ€
β΅ββ΄β β΅
β·β¬ β·
React 170.5 KiB ββββββββββ€
β΅β΄ β΅
β·βββ¬ββ β·
! Jsxte 170.6 KiB ββ€ β βββββββ€
β΅βββ΄ββ β΅
ββ¬β β·
HonoJsx 170.5 KiB ββββββββββ€
ββ΄β β΅
β·ββββ¬ β·
* CommonTags 211.3 KiB ββ€ βββββββββββββββ€
β΅ββββ΄ β΅
β¬ β·
* Ghtml 204.5 KiB βββ€
β΄ β΅
β¬ β·
* HonoHtml 204.5 KiB βββ€
β΄ β΅
β β
103.38 Β΅s 2.64 ms 5.17 ms
Sizes are the final html output based on the same input.
!) Are jsx runtimes that produces different output from React for the same input β οΈ
*) Are template engines, which usually lacks syntax highlighting and intellisense:
https://github.com/kitajs/html/blob/master/benchmarks/templates/normal.tsx
{
"common-tags": "1.8.2",
"ghtml": "4.0.2",
"hono": "4.12.2",
"html-minifier": "4.0.0",
"jsxte": "3.3.1",
"mitata": "1.0.34",
"nano-jsx": "0.2.1",
"preact-render-to-string": "6.6.6",
"react-dom": "19.2.9"
}The RealWorldPage benchmark is the most meaningful since it represents a realistic
workload scenario. Other benchmarks serve specific purposes, such as measuring the speed
of creating individual elements or handling attribute injection and escaping.
It's essential to emphasize that all benchmarks aim for impartiality. Any perceived bias towards a particular library should be promptly reported, and corrective actions will be taken swiftly.
We are committed to addressing any discrepancies or unfairness in the benchmarks promptly. Updates reflecting corrections will be publicly shared as soon as they are available.
Feel free to reach out if you have any concerns or suggestions for improving the benchmarking process. Your feedback is invaluable in ensuring the fairness and accuracy of our comparisons.
Also, feel free to contribute benchmarks for any library you're interested in by opening a pull request (PR). If you need assistance or wish to suggest a library for benchmarking, don't hesitate to open an issue.
KitaJS/Html prioritizes performance while maintaining a user-friendly and intuitive API. Its design ensures not only speed but also a seamless developer experience (DX). Since this code may run on every request, its primary objective is speed, with a secondary focus on maintaining developer productivity.
The library adheres to the JSX standard for its API, shielding users from the complexities of its internal workings. This approach allows us to optimize the underlying implementation extensively, including function inlining, to achieve maximum performance.
I tried multiple formatters and minifiers to ensure the html output of all runtimes is
consistent, however vhtml and common-tags aren't consistent at all, with weird behaviors
like adding spaces between components and rendering 0 as an empty string...
As react is by far the JSX standard these days, KitaJS/Html is only required to produce the same output as ReactDOMServer.renderToStaticMarkup.
To be sure we are emitting a similar output and none of the libraries are emitting broken HTML, a realWorldPage is rendered and stored at the samples directory.