tectonic icon indicating copy to clipboard operation
tectonic copied to clipboard

`tectonic -X build` performance

Open tronje opened this issue 2 years ago • 3 comments

Hi! I'm trying out tectonic because my document takes about 15s to clean-build and 10s to re-build after a minimal change using my go-to tool rubber. I've set up the same document using a tectonic workspace, and I'm building with tectonic -X build.

Now, the build works fine, which is really cool, by the way. Impressive work! But unfortunately, it also takes a little over 20s on my machine, and it appears to do a full build every time. Even if I add the -k flag, and without having made any changes to any .tex file.

I had hoped that a modern engine might improve performance, and perhaps make more efficient use of the myriads of intermediate files that a standard LaTeX build seems to generate. Do you have any thoughts on this? Or is this actually a bug? Let me know if you need me to provide any logs; if needed, I could give you access to the whole project, but it's currently private on Gitlab, and I'd like to keep it that way if at all possible.

I'm using tectonic 0.12.0. Also note that the build times may seem exaggerated to you, but I'm building on a i5-6200U CPU.

tronje avatar Feb 22 '23 15:02 tronje

Hey @tronje thanks for the issue!

Just to clarify, do you mean something like latexmk's -pvc option that attempts to only regenerate the necessary files, making it faster for live/continuous compilation?

Neved4 avatar Feb 22 '23 16:02 Neved4

Hey @tronje thanks for the issue!

Thanks for responding :)

Just to clarify, do you mean something like latexmk's -pvc option that attempts to only regenerate the necessary files, making it faster for live/continuous compilation?

Well I usually use rubber; I just experimented with latexmk for the first time today actually, and I guess the -pvc option is neat and maybe what I want. But what I was getting at with the issue was just that tectonic has a really long build time. Obviously an initial build takes a while because tectonic downloads dependencies first. But even after this initial build has succeeded, if I start a new build right away, it takes a rather long time.

For example (times are different because I'm sitting on a more powerful machine now):

$ time tectonic -X -c minimal build
tectonic -X -c minimal build  13.24s user 0.45s system 99% cpu 13.728 total
$ time tectonic -X -c minimal build
tectonic -X -c minimal build  13.31s user 0.50s system 99% cpu 13.842 total

vs.:

$ time rubber -q --unsafe --pdf index
rubber -q --unsafe --pdf index  7.71s user 0.25s system 99% cpu 7.976 total
$ time rubber -q --unsafe --pdf index
rubber -q --unsafe --pdf index  2.40s user 0.09s system 100% cpu 2.482 total

(I didn't modify the source at all between the tectonic invocations, but I did make a minor change between rubber invocations because rubber tries to be smart and doesn't rebuild if there are no changes).

I should also point out that tectonic actually prints a bunch of warnings, but I assumed they're unrelated to performance. Maybe the poor performance for me is related to my using minted? I seem to get a lot of warnings about that: tectonic.log

Do you think maybe it's got something to do with my project that tectonic is taking a long time to build? I can provide more logs/info if you need it.

tronje avatar Feb 22 '23 20:02 tronje

What you're describing is right: tectonic does a full build every time, regardless whether a previous build already is in place. It's not deciding which steps can be skipped to make the compilations faster, like latexmk or rubber do. I'd very much like that level of smart granularity! 🚀

Neved4 avatar Apr 19 '23 09:04 Neved4