0

I've recently had to move my LaTeX setup from my personal Ubuntu environment to a new business laptop with Windows 10 installed. For this reason I resorted to Powershell which apparently competes favorably with the Linux command line.

In an attempt to replicate the original Ubuntu environment as closely as possible I installed texlive and make from the Chocolatey index. After some difficulty I managed to install the full scheme using the following command:

choco install texlive --params="'/scheme:full'" --execution-timeout=14400

I then made a simple project as follows:

Makefile
template.tex

Where Makefile contains the following:

SHELL=powershell.exe
compile:
        latexmk -pdf template.tex
clean:
        get-childitem -file | where {($$_.extension -ne ".tex") -and  ($$_.extension -ne ".pdf") -and ($$_.extension -ne ".bib") -and  ($$_.name -ne "Makefile")} | remove-item

and template.tex contains the following:

\documentclass[a4paper, 12pt]{article}
\usepackage{glossaries}

\makeglossaries

\newglossaryentry{item} { name=ITEM, description={Italian Train Engine Management} }

\begin{document} some text \gls{item} \clearpage \printglossaries

\end{document}

In order for glossaries to work I had to include the sample latexmk rc files based on this question. Then I attempted to compile this simple example as follows:

measure-command {make compile}

Which resulted in the following:

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 6
Milliseconds      : 200
Ticks             : 62007140
TotalDays         : 7.17675231481481E-05
TotalHours        : 0.00172242055555556
TotalMinutes      : 0.103345233333333
TotalSeconds      : 6.200714
TotalMilliseconds : 6200.714

I was surprised by the high compilation time and I don't think I can proceed until it drops drastically. I have the following questions:

  • Could the high compile time have anything to do with the fact I installed the full scheme? If so, what can I do about that?
  • How can I pinpoint what is causing such a high compile time and eventually remedy it?

EDIT: Regarding the use of ls-R files

As prompted by the comments I have asked the question in the issue page for the chocolatey version of texlive. I copy the response here:

Technically, under the hood chocolatey simply invokes the installer provided by TexLive http://tug.org/texlive/acquire-netinstall.html for Windows. So, I would say it should similar to manually running the gui version of this installer.

So I guess if the installer provided by TexLive for Windows has TEXINPUTS set in a way that causes TeX to search the disk rather than use its pre-hashed ls-R files, then chocolatey will do this also. The next logical question would be Does the installer provided by TexLive for Windows have TEXINPUTS set in a way that causes TeX to search the disk rather than use its pre-hashed ls-R file?s

user32882
  • 1,594
  • if I understand you right you are running latex makeglossaries then latex again a couple of times in a total of six seconds, what time would you expect from linux on similar hardware? (the time is unlikely to be affected by the initial install scheme) – David Carlisle Sep 22 '21 at 21:20
  • when I satrted using tex, several minutes per page was not uncommon so 6 seconds for multiple runs doesn't seem slow. Of course make and latexmk also have some overhead, you should time a direct run of pdflatex – David Carlisle Sep 22 '21 at 21:26
  • An easier way to get the timing is to run latexmk with the -time option. It will show the total time, and the timing for the runs of pdflatex. I'd suggest reporting those timings. By my measurements, the time overhead for latexmk is small compared with the time for running the programs invoked. – John Collins Sep 22 '21 at 22:07
  • Don't forget there's a substantial overhead in pdflatex in the compilation of your document. The time needed for a big document will probably be quite a bit less than you'd think by scaling up the observed 6 sec. – John Collins Sep 22 '21 at 22:16
  • @DavidCarlisle I don't have a comparison for similar hardware. My new laptop is slightly less performant than my old laptop (core i5 vs core i7), and in the i7 it would run in less than a second. I think 6 seconds total compile time is way too high, especially since I compile frequently to check the resulting document. – user32882 Sep 23 '21 at 06:20
  • 1
    a common reason for pdflatex being slow is having TEXINPUTS set in a way that means tex has to search the disk rather than use its pre-hashed ls-R files. Also if the directory being used is syncing with dropbox or google drive or whatever. I'm not familiar with choclately is that installing the standard windows texlive tex or is it (like the cygwin version that I use normally) installing a custom compilation using a posix layer over windows? – David Carlisle Sep 23 '21 at 06:29
  • I am not syncing with a cloud storage service such as google drive or dropbox so that can immediately be ruled out. With regards to the use of pre-hashed ls-R files I asked the developer of the chocolatey texlive package and gotten a response. Would you care to take a look at the edit to my original question? – user32882 Sep 23 '21 at 18:04
  • @DavidCarlisle is there anything I can do to improve or make the question clearer/easier to answer? – user32882 Sep 24 '21 at 12:41
  • I would say the times look normal for windows. I get (without the makeglossary call) reported times from 4-5 seconds at the first run. – Ulrike Fischer Sep 25 '21 at 09:07
  • @UlrikeFischer I would argue that makes TeX almost unuseable on Windows then. I compile maybe 3 to 4 times a minute to continuously check the result and make adjustments. If it takes 4-5 seconds each time that's about 1/3 of the time spent waiting on the compilation to finish for simple .tex files. Add in libraries like glossaries which require multiple compilation runs, and larger documents which might call TikZ or graphicx then you might be exceeding half the total time spent compiling. There has got to be a better way. – user32882 Sep 25 '21 at 09:57
  • Well I always used TeX on windows, and I don't find it unuseable. – Ulrike Fischer Sep 25 '21 at 10:06
  • @UlrikeFischer as an experienced TeX user I feel like you might have less of a need to compile frequently. As a beginner I feel like I need to compile very frequently to make sure the changes in the code reflect what I want to see in the resulting PDF. – user32882 Sep 25 '21 at 10:10

0 Answers0