Performance
How fast mLaTeX is against pdfLaTeX, XeLaTeX, LuaLaTeX and Typst, how it was measured, and how to time your own documents.
Full build, geometric mean over seven documents; 19× to 47× by document.
Full build, geometric mean over seven documents; 43× to 86× by document.
Full build, geometric mean over seven documents; 34× to 83× by document.
Full build, geometric mean over seven documents; 1.3× to 4.7× by document.
pdfLaTeX 2.03 s, XeLaTeX 5.29 s, LuaLaTeX 5.54 s and Typst 185 ms.
mLaTeX's worst build. pdfLaTeX 132 MB, XeLaTeX 348 MB, LuaLaTeX 185 MB and Typst 147 MB.
Results
Time to a finished PDF
Each bar is the median of every measured build. Hover a document for each program's number, switch between the full build, the first pass, CPU time and memory, and click one to hide it: hide the three LaTeX programs to compare mLaTeX with Typst at their own scale.
Median wall-clock time to a finished PDF: for LaTeX every pass until references settle, and BibTeX when the document cites. Hover a document to read its numbers here; click an program to hide or show it.
Every number
Every number behind the chart, as files for a spreadsheet or your own analysis: a summary of each document and program, every measured build, and the raw record.
results.csv
35 rows: each document and program's median, fastest and 90th-percentile build, first pass, CPU time, memory, pages, PDF size and steps.
builds.csv
700 rows: every measured build's round, wall time, first pass, CPU time, memory and steps.
results.json
The raw record, with the machine, the programs' versions and the sandbox's settings.
The output
Page against page
The PDFs each program made. Move across a page and the wipe follows, from one program to the other; drag on a touch screen, or use the arrow keys. Show all five side by side, or overlay two in difference mode, where everything that matches turns black.
Why the pages are not identical
mLaTeX sets the same text in the same fonts and sizes as pdfLaTeX, XeLaTeX and LuaLaTeX, but it spaces headings and breaks lines and pages with its own code rather than TeX's. A block of text can sit a little higher or lower, a line can end at a different word, and a long document can come out a page shorter or longer. The difference view shows exactly where.
Typst sets the same words from its own source, with its own layout rules, so its pages differ more: its headings, lists, theorems and captions follow Typst's conventions, made to look like LaTeX's where the source can say so.
The test documents
What each one tests
Every document exists twice, with the same text. The .tex file is plain LaTeX that mLaTeX, pdfLaTeX, XeLaTeX and LuaLaTeX read unchanged, with the default Computer Modern fonts and no packages written for one program. The .typ file is the same document written in Typst, set in New Computer Modern, the modern edition of the same Computer Modern design, which Typst ships with. The text is generated from a fixed seed, so every run sets exactly the same words.
| Document | What it exercises | In Typst |
|---|---|---|
| Startup | One sentence on one page: what starting mLaTeX costs. | The same sentence. |
| Structure | Eight sections with a contents, footnotes, lists, cross references and hyperref. | Headings, outline, footnote, lists and ref, including page references. |
| Expressions | Twenty-four amsmath displays: align, gather, cases, matrices, theorems and proofs. | Typst's math, mat and cases, and a small theorem and proof function. |
| Tabular | booktabs, tabularx, multirow, six floating tables and a 120-row longtable that breaks across pages. | table with rules, a spanning cell and a header repeated on every page. |
| Graphics | Twelve TikZ drawings, flowcharts and plotted curves, and three pgfplots axes. | The same drawings with Typst's own shapes and curves, no packages. |
| Citations | natbib citing a 40-entry BibTeX file, references.bib. | cite and bibliography, reading the same references.bib. |
| Monograph | A twelve-chapter report of about 110 pages with a contents, footnotes, equations and cross references. | Chapters on new pages, outline, footnotes, equations and ref. |
The sources
How it was measured
The machine
| Processor | AMD Ryzen 7 5800X 8-Core Processor, 8 cores, 16 threads |
|---|---|
| Memory | 16 GB |
| System | Windows-11-10.0.26200-SP0 |
| mLaTeX | mlatex 0.1.0, Clang 22 release build |
| pdfLaTeX | pdfTeX 3.141592653-2.6-1.40.29 (TeX Live 2026) |
| XeLaTeX | XeTeX 3.141592653-2.6-0.999998 (TeX Live 2026) |
| LuaLaTeX | LuaHBTeX, Version 1.24.0 (TeX Live 2026) |
| Typst | typst 0.15.1 (9dfd3a08) |
| Measured | 700 builds in 20 rounds, after 2 warm-up builds of each |
| Run | 16 Oct 2026, 01:12 to 16 Oct 2026, 01:32 UTC |
| Idle load | 6.4% before, 4.3% after |
The sandbox
Every build is isolated, so neither the machine's own settings nor one program's leftovers can affect another:
- A fresh folder. Each build starts in an empty folder holding only its document and
references.bib, deleted afterwards. - A scrubbed environment. Only the system folder and TeX Live are on
PATH, and the build gets a private home with its ownTEXMFHOME,TEXMFVARandTEXMFCONFIG, so no personal TeX configuration or cache applies. - A job object. Each build is a Windows job, started suspended and assigned before it runs a single instruction. The job pins it to one hardware thread on each of the eight physical cores, caps its memory at 4 GB, and counts CPU time and peak memory across every process it starts, xdvipdfmx and BibTeX included.
- No reach outside. TeX runs without shell escape and may only write inside its own folder (
openout_any=p); mLaTeX runs--offline; Typst uses only the fonts it ships with and loads no packages, so it has nothing to download. - High priority. Every program's process starts at high priority.
The builds
mlatex -q --offline structure.texOne run makes the finished PDF: references, the contents and citations are resolved in memory.
pdflatex -interaction=batchmode -halt-on-error -no-shell-escape structure.tex
bibtex -terse citations # only when the document cites
pdflatex -interaction=batchmode -halt-on-error -no-shell-escape structure.texThe first pass runs, then BibTeX if the .aux file names a bibliography, then more passes while the log asks for a rerun, as latexmk would.
xelatex -interaction=batchmode -halt-on-error -no-shell-escape structure.texThe same passes as pdfLaTeX. XeLaTeX hands each page to xdvipdfmx, which the job counts as part of the build.
lualatex -interaction=batchmode -halt-on-error -no-shell-escape structure.texThe same passes as pdfLaTeX. LuaLaTeX finds its fonts through luaotfload, whose font cache the warm-up builds before anything is measured.
typst compile --ignore-system-fonts structure.typ structure.pdfOne run makes the finished PDF: Typst repeats its layout inside the run until references settle.
Repetitions
- Warm-up. Two builds of every document by every program come first and are not counted, so font caches exist and every file is in the system's cache for all five.
- Rounds. Then twenty rounds, each building every document once with each program, in an order shuffled afresh for every document. A busy moment on the machine lands on all five programs alike instead of on one.
- Timing. Wall-clock time runs from creating the first process to the last one exiting, so process start-up counts for every program.
What it does not cover
- The same input for Typst. Typst cannot read LaTeX, so it sets translations of the documents. They hold the same words, structure, equations, tables and drawings, but they are not the same file, and a Typst document written another way could be faster or slower.
- Typst's packages. The drawings use Typst's built-in shapes. A document using a package such as CeTZ, as most Typst drawings do, also pays to load it.
- The machine itself. The builds share the computer with whatever else it was doing; the idle load before and after is listed above.
- Other systems. The run is on Windows; starting processes and finding files cost differently on Linux and macOS.
- Other fonts. Every document uses Computer Modern. Documents that load system fonts were not measured.
Running the benchmark
Requirements
Python 3 with psutil and Pillow, TeX Live, Typst, and an mLaTeX build, on Windows: the sandbox uses Windows job objects.
The scripts
| Script | What it does |
|---|---|
corpus.py | Writes the seven documents in LaTeX and in Typst, and references.bib. |
harness.py | Runs every build in the sandbox and writes results.json. |
export.py | Turns results.json into this page's data and renders each PDF's pages. |
results.json | This run's raw record: every build's steps, wall time, CPU time and peak memory. |
Commands
python -I corpus.py corpuspython -I harness.py corpus results 20harness.py finds TeX Live, mLaTeX and Typst on PATH, or where TEXBIN, MLATEX and TYPST point when they are set; its last argument is the number of rounds.
Timing your own documents
--time
mlatex --time paper.texTime
Finding the document and its assets 0.1 ms
Setting it and writing its PDF 4.7 ms
In all 4.9 msThe clock starts when the program starts running, so --time leaves out starting the process and loading the program, which the wall-clock times above include.
--time-statistics
--time-statistics prints mLaTeX's own report instead: every stage, what it made and how long it took, in microseconds. It is the place to look when one document is slower than you expect.
Why it is fast
No macro layer for LaTeX itself
LaTeX's kernel, its packages and much of TeX are written in TeX macros, which a TeX program expands token by token, again on every run. In mLaTeX the page builder, floats, tables, lists, headings, citations and TikZ are compiled code.
One pass, in memory
References and page numbers are found in a second pass held in memory rather than by running the whole program again.
Nothing loaded that is not used
Packages and English hyphenation are compiled into the program; another language's patterns are read when it is chosen; the glossary of commands costs one lookup the first time a name is used; links, bookmarks and the index are made only for documents that ask for them.
Little work per picture
A JPEG is embedded as it came, never decoded. Fonts are cut down to the glyphs used.
Fonts opened early
The fonts a document is likely to need are opened on another thread while mLaTeX starts up.
What it means in practice
A live preview
A document set in milliseconds can be set again on every save, which is what --watch does:
mlatex --watch --open paper.texDocuments on request
A program embedding mLaTeX can make documents in a request handler without a queue or a second process. See Embedding.

