-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Latexmk in a more efficient way for 'xelatex'
as latex_engine
#12636
base: master
Are you sure you want to change the base?
Conversation
Testing note that these builds are on a very old laptop and everyone else is going to observe faster build times. With this PR (xeatex 2019):
Without (of course cleaning all auxiliaries from latex build first) (xelatex 2019)
WIth TeXLive 2024: With this PR (xelatex 2024):
Without this PR (xelatex 2024):
Each build uses 3 LaTeX passes. Observe the way LaTeX is slower nowadays... I also observed some warnings which look inocuous
(anyhow when Now, it is expected that there will be gains when the PDF uses a lot of graphics inclusions, which is not the case with our own docs. Not having experimented with that, I see no strong case to merge this PR in time for If globally the gains are non-existent as above timings indicate, maybe better not to change anything at all. In the meantime the advice seems to be to stick with some TeXLive 2019 based LaTeX rather than rush to modern one... edit: I had been wondering if my TL2019 binary (xelatex with this PR, binary from 2019, LaTeX macro layer from 2024)
|
I added the The main lesson is that you should set-up your build environment to use a complete LaTeX distribution dating back to TeXLive 2019 or more ancient. Avoid newer LaTeX (we can see a 50% increase in build time from 2019 to 2024 regarding sphinx.pdf !!). Sphinx uses very solid LaTeX packages most of them not having changed for a decade or more and is has very substantial internal LaTeX coding for code-blocks, tables, and admonitions (inclusive of recent #12508 supporting colourful admonitions). It does not especially benefit from being run on current LaTeX. It was better in the past, as everyone knows. Build times with TL 2019 (pdflatex):
TL 2024 (pdflatex):
as mentioned in my previous comment, I have a slight doubt about whether my TL2019 binaries were self-compiled with optimization flags for speed, but I do not think so, and my current understanding is that the decreased performance is due to additional overhead from recent LaTeX macro layer, not from the binaries. EDIT: to dispel my doubts I used the 2019
This shows that the faster speed with TeXLive 2019 is not due to some special binary build I did from sources with compiler flags for speed. It is due to the extra stuff loaded in the LaTeX macro layer and the extra processing it has added. (it is not from used LaTeX packages, they must have very little changed). |
To test if your project using
The behavior at step 5 is what this PR makes default. instructions given for OSes supporting |
Subject: improve (slightly) efficiency of xelatex builds
We have said for a long time in our docs:
After some complex chase (as I could not find a Change log with release dates at Latexmk home going far back enough), it appears that from this Changes files without dates and CTAN announcements that both
-xelatex
and-lualatex
options have been available since at least 2013, but that there was important changes at 4.52 of January 2017 to which the above tip was actually referring.Starting from this date the
-xelatex
option triggered faster builds by Latexmk because it produces the PDF only once at very end of the multiple LaTeX passes. In the intermediate passes it produces.xdv
files which is a bit faster process than producing PDF file.What my PR does is to modernize our Makefile to use that
-xelatex
option (and-lualatex
). Currently I can only test it on TeXLive 2019 LaTeX distribution not on earlier ones (and of course on current TL2024). I thus think that the change will not impact Sphinx users, even with very obsolete LaTeX installations. Due to this I have added it to 8.x milestone but hesitate about asking for inclusion in 8.0.0 (ping @AA-Turner). I will be able to test on antequated systems only in a few weeks, and depending on my schedule during transfers perhaps not until September.Only the Makefile is changed, the
latexmkrc
Perl configuration appeared to require no change.One should not expect miracles though in terms of performance improvement.
Commits will be added to update docs after opening the PR.
Relates