You are not logged in.

#1 2019-02-07 14:01:43

m8mble
Member
Registered: 2019-02-07
Posts: 10

[SOLVED] Slow compilation with pdflatex from texlive-bin

I'm working on a rather large, private tex project. For months I have been building it on an old laptop. This machine was not running Arch. In this setup, compiling the whole project took ~ 5 min (including all of the multiple pdflatex calls).

New year -- fresh start: By now I do no longer own said laptop. I setup a new box with Arch on more beefy hardware (more cpus, faster cpu, faster SSD, more RAM, etc.). In this setup, compiling the exact same source takes > 90 min.

Surely, both setups are hard to compare. Moreover, building tex projects involves more components than just pdflatex. But in my case, pdflatex consumes at least 90% of the observed time. In the new setup, I even noticed single pdflatex calls taking more than 5 mins. Recall that this time sufficed to build the entire project in my old setup.

The question is: Why is this the case? I'm not concerned with a few seconds, but I don't see any reason why my build times shouldn't match the old setup on superior hard- and software.

In an attempt to resolve the slowdown, I noticed that the pdflatex binary provided by texlive-bin 2018.48691-5 contains debug symbols. I was wondering whether it has actually been compiled with optimizations. But I couldn't find out if this is actually the case.

I'd also appreciate any suggestions for narrowing down this slowdown. I could try to build a VM with the old setup for reasons of comparison in case this might be of any help...

Last edited by m8mble (2019-02-08 10:29:22)

Offline

#2 2019-02-08 10:29:03

m8mble
Member
Registered: 2019-02-07
Posts: 10

Re: [SOLVED] Slow compilation with pdflatex from texlive-bin

I solved it. For some reason, my /etc/passwd contained

m8mble:x:1337:985:me:/home//m8mble:/usr/bin/zsh

The key insight here, is the double slash after home.

Using lsof I found out, that pdflatex is traversing parts of my home that it was not supposed to consider. What input paths are considered by pdflatex can be queried using: kpsexpand \$TEXINPUTS. And apparently in this context, double slashes have a special meaning. They mean: "consider everything from here on". This is why my entire (huge) home has been traversed for any \import in my tex-source.

The workaround is to remove all double slashes in /etc/passwd. This might be a good idea anyways, unless you are interested in debugging the next tool stumbling over this edge-case config. Moreover I'm unsure whether this is a bug in kpsexpand, but I'll open a github issue for this discussion.

As an open question it remains why pdflatex contains dbg-symbols.

Offline

Board footer

Powered by FluxBB