What are biggest slowdowns in LaTeX (compilation speed)

Unanswered

The benchmark posted recently got me thinking. Although kids these days don’t know how good they have it (LaTeX runs used to take minutes, not seconds), modern typesetting engines like Typst are faster due to (presumably) shedding a lot of historical baggage.

If we assume no change to the actually page layout algorithms in LaTeX (there are good reasons they will always require multiple passes), what are the main areas for potential improvement in the future?

* the monolithic texmf structure? File lookup is cached so shouldn’t be *too* slow, but I remember in the past when installing minimal TeX Live installations they seemed to be snappier. Do we need to cull unneeded files from texmf?

* many file I/O operations? I remember compilation speeds improving significantly when we switched to SSDs everywhere. Should third party packages try harder to use docstrip to bundle their code into single files only? Should there be a dynamic caching step so if the preamble doesn’t change it can be loaded from a precompiled dump? Images can be slow to load, are there steps in this process that could be multithreaded? (I.e., LaTeX only needs to know the size, it’s only the PDF embedding that requires the full content.)

* the TeX machinery itself? Switching from TeX code entirely isn’t feasible in the short term but is there something the engine can do to make the macro expansion language more efficient? A better hashmap? Some kind of JIT system that attempts to “compile” TeX code before executing it?

Posted Jun 29, 2026, 11:37 PM UTC

3631
Loading comments…