Short version: The tikz externalize library takes something like 2-3 seconds to compile a single very simple diagram. As a result, when there are many diagrams, the first run of pdflatex is really long. For instance, my documentation (52 pages) was taking 41 seconds to compile without externalization, now it takes 13 minutes (x20). Hopefully the second run is much smaller (3 seconds)... but because of this bug if I just add a single diagram at the beginning of the document, I need to recompile everything because the file name change... and therefore I'm back to a 13mn compilation.
Is it normal? If yes, is it possible to decrease this time somehow? For instance, I've the feeling that what takes most of the time is the action of starting LaTeX. It would be cool if it were possible to pre-load LaTeX only once and compile multiple times with the same pre-loaded LaTeX.
EDIT
I'm reading the documentation, and I see that tikz externalize actually uses the current document as the base. So it means that if I load many libraries, then the current document will likely take much more than 3 seconds to load... and therefore tikz externalize will be even slower. Maybe my question would be solved if we can find a way to provide a "template" to the externalize program.
EDIT
I guess that \tikzsetfigurename can be used to limit the effect of the bug by giving different names to parts of the file... But I still need to pay the high price to compile the first pictures. I'm particularly worried when the main document loads a lot of library.
mylatexormylatexformat) – David Carlisle Feb 08 '22 at 19:40\includegraphicspicture mode is preferable. Also in LuaTeX there is native Metapost which is really fast. – Henri Menke Feb 08 '22 at 21:56\putinto the page hook mechanism so you can position background images etc without much overhead. – David Carlisle Feb 08 '22 at 21:58.dpthfiles have this:$ cat file-figure9.dpth \oddpage@label{45}{24}– tobiasBora Feb 09 '22 at 15:30list and makewhich allows parallel processing. You might want to read up on that as well. – TeXnician Feb 09 '22 at 16:46