1

Suppose I have a simple document like the following:

\documentclass{article}

\begin{document} test \end{document}

Suppose I need to use LuaLatex for reasons not worth mentioning here. I can use the --quiet flag to decrease compilation time as follows:

latexmk -lualatex --quiet a.tex

Other than using the --quiet flag, what else can I do to improve performance for this simple example?

user32882
  • 1,594
  • 3
    get a faster machine? Just use lualatex and not latexmk? I doubt this question has any reasonable answer as any parts that could possibly be optimised will be the code described as "I need to use LuaLatex for reasons not worth mentioning here." – David Carlisle Dec 15 '22 at 17:43
  • on my machine latexmk --luatex is about 50% slower than luatex on this document (probably due to --recorder – David Carlisle Dec 15 '22 at 17:49
  • You might find some inspiration at https://tex.stackexchange.com/questions/8791/speeding-up-latex-compilation -- which suggestions apply or don't apply to your code is hard to tell without actually seeing your code. – samcarter_is_at_topanswers.xyz Dec 15 '22 at 17:57
  • @DavidCarlisle on my machine, compiling with lualatex is actually slower, I'm guessing because latexmk can suppress all those log messages with --quiet, while lualatex doesn't appear to be able to do that. With regards to --recorder, compiling with latexmk --recorder and latexmk --recorder- has no impact on the calculation time. – user32882 Dec 16 '22 at 07:51
  • latexmk is just a script that runs luatex and other things so it is necessarily slower. you can use batchmode on the lustex commandline. recording all file access to an extra file takes time as does checking whether those files have changed which is what latexmk is doing to decide whether 5o run latex again. – David Carlisle Dec 16 '22 at 08:18
  • @DavidCarlisle using the --recorder- flag (note the minus sign at the end) suppresses all file recording with LatexMK. – user32882 Dec 16 '22 at 10:22
  • Recent versions of the LaTeX macroshave a hook to the last page of a document (as of the last compile) that gets stored in the .aux file. Latexmk treats this as a cross-reference so will typeset very dimple documents, that could be typeset in a single pass, twice. You can stop this by creating a latexmkrc file that contains the line $hash_calc_ignore_pattern{'aux'} = '@abspage@last'; to tell latexmk to ignore that aux file entry. – Herb Schulz Dec 16 '22 at 19:23

0 Answers0