Typlet and KaTeX compared
This page renders 73 formulas in your browser, with Typlet from their Typst source or with KaTeX from their LaTeX source, and times each step. They are the formulas of the gallery that both can draw. Choosing a renderer loads the page again, so that every measurement starts from a fresh page.
Rendering…
What the times measure
- The library is ready when the browser has fetched its script and its stylesheet and has run the script. On a first visit this includes compiling the script.
- The first formula runs the renderer's code for the first time, which takes longer than the formulas after it. All formulas is the time in the calls to
render, the first among them, which put each formula's HTML into the page. - The layout is the browser's own work to style and place what was rendered, before the fonts arrive.
- Render again empties the formulas and renders them once more, now that the browser has compiled the code they run.
- The sizes are what the browser fetched, compressed if the server compresses. Both renderers load only the fonts that the page's characters need.
- With both side by side, the two run one after the other in one page, Typlet first. For a measurement of one alone, choose it alone.
Both render their default output: HTML to look at, and MathML for screen readers. Typlet draws formulas at the size of the text around them and KaTeX at 1.21 times that, so this page shows Typlet's at KaTeX's size.