6

I have a computer with OSX Mavericks (10.9) running on it, as well as a debian wheezy VM on the same machine, assigned a conservative 2/8 of the cores, and 4Gb/16Gb ram.

On the VM I have texlive-base and dependencies installed, plus maybe a couple non-dependencies which I cannot remember now, but can find out it it matters. On OSX I have both mactex and 'texlive' via ports.

Counter intuitively, compiling latex documents is significantly faster in linux (the VM), than in OSX, where I tried both the installed distributions.

Following are the timings for a compile of this file (note: to compile you will also need this file) with the macports latex and the debian latex. Note hoe the debian latex is about 2.5 times faster. I have not compiled this file with the mactex distribution, but I found that it is about 5x slower even than the macports one. My question is, why is either of them so slow?

Linux:

This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian)
 restricted \write18 enabled.
entering extended mode
(./paper.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, lo
aded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo))
(/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
(/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty))
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/dvips.def)))
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty)
(/usr/share/texlive/texmf-dist/tex/latex/amscls/amsthm.sty) (./paper.aux)
*geometry* driver: auto-detecting
*geometry* detected driver: dvips
(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd) [1] [2] [3]
(/usr/share/texlive/texmf-dist/tex/latex/base/omscmr.fd)

LaTeX Warning: Citation `amsldoc' on page 4 undefined on input line 275.

[4] [5] [6] [7] [8]

LaTeX Warning: Citation `amsldoc' on page 9 undefined on input line 579.


LaTeX Warning: Citation `amsthdoc' on page 9 undefined on input line 579.


Overfull \hbox (1.28pt too wide) in paragraph at lines 605--612
\OT1/cmr/m/n/12 struc-ture. For ex-am-ple, this sec-tion is la-beled us-ing the
 com-mand []\OT1/cmtt/m/n/12 \label{sect:cross-ref}\OT1/cmr/m/n/12 .
[9]

LaTeX Warning: Citation `knuth84' on page 10 undefined on input line 649.

<doodle.eps> [10]

LaTeX Warning: Citation `lamport' on page 11 undefined on input line 774.


LaTeX Warning: Citation `amsldoc' on page 11 undefined on input line 776.


LaTeX Warning: Citation `amsthdoc' on page 11 undefined on input line 777.


LaTeX Warning: Citation `latex-companion' on page 11 undefined on input line 77
9.


LaTeX Warning: Citation `math-into-latex' on page 11 undefined on input line 78
0.


LaTeX Warning: Citation `kopka03' on page 11 undefined on input line 780.


LaTeX Warning: Citation `latex-graphics' on page 11 undefined on input line 781
.

[11]

LaTeX Warning: Citation `knuth84' on page 12 undefined on input line 784.

No file paper.bbl.
[12] (./paper.aux)

LaTeX Warning: There were undefined references.

 )
(see the transcript file for additional information)
Output written on paper.dvi (12 pages, 35156 bytes).
Transcript written on paper.log.
latex paper.tex >&2  0.02s user 0.06s system 98% cpu 0.081 total

OSX:

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/MacPorts 2013_5)
 restricted \write18 enabled.
entering extended mode
(./paper.tex
LaTeX2e <2011/06/27>
Babel <3.9f> and hyphenation patterns for 43 languages loaded.
(/opt/local/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/opt/local/share/texmf-texlive/tex/latex/base/size12.clo))
(/opt/local/share/texmf-texlive/tex/latex/geometry/geometry.sty
(/opt/local/share/texmf-texlive/tex/latex/graphics/keyval.sty)
(/opt/local/share/texmf-texlive/tex/generic/oberdiek/ifpdf.sty)
(/opt/local/share/texmf-texlive/tex/generic/oberdiek/ifvtex.sty)
(/opt/local/share/texmf-texlive/tex/generic/ifxetex/ifxetex.sty))
(/opt/local/share/texmf-texlive/tex/latex/graphics/graphicx.sty
(/opt/local/share/texmf-texlive/tex/latex/graphics/graphics.sty
(/opt/local/share/texmf-texlive/tex/latex/graphics/trig.sty)
(/opt/local/share/texmf-texlive/tex/latex/latexconfig/graphics.cfg)
(/opt/local/share/texmf-texlive/tex/latex/graphics/dvips.def)))
(/opt/local/share/texmf-texlive/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/opt/local/share/texmf-texlive/tex/latex/amsmath/amstext.sty
(/opt/local/share/texmf-texlive/tex/latex/amsmath/amsgen.sty))
(/opt/local/share/texmf-texlive/tex/latex/amsmath/amsbsy.sty)
(/opt/local/share/texmf-texlive/tex/latex/amsmath/amsopn.sty))
(/opt/local/share/texmf-texlive/tex/latex/amsfonts/amsfonts.sty)
(/opt/local/share/texmf-texlive/tex/latex/amscls/amsthm.sty) (./paper.aux)
*geometry* driver: auto-detecting
*geometry* detected driver: dvips
(/opt/local/share/texmf-texlive/tex/latex/amsfonts/umsa.fd)
(/opt/local/share/texmf-texlive/tex/latex/amsfonts/umsb.fd) [1] [2] [3]
(/opt/local/share/texmf-texlive/tex/latex/base/omscmr.fd)

LaTeX Warning: Citation `amsldoc' on page 4 undefined on input line 275.

[4] [5] [6] [7] [8]

LaTeX Warning: Citation `amsldoc' on page 9 undefined on input line 579.


LaTeX Warning: Citation `amsthdoc' on page 9 undefined on input line 579.


Overfull \hbox (1.28pt too wide) in paragraph at lines 605--612
\OT1/cmr/m/n/12 struc-ture. For ex-am-ple, this sec-tion is la-beled us-ing the
 com-mand []\OT1/cmtt/m/n/12 \label{sect:cross-ref}\OT1/cmr/m/n/12 .
[9]

LaTeX Warning: Citation `knuth84' on page 10 undefined on input line 649.

<doodle.eps> [10]

LaTeX Warning: Citation `lamport' on page 11 undefined on input line 774.


LaTeX Warning: Citation `amsldoc' on page 11 undefined on input line 776.


LaTeX Warning: Citation `amsthdoc' on page 11 undefined on input line 777.


LaTeX Warning: Citation `latex-companion' on page 11 undefined on input line 77
9.


LaTeX Warning: Citation `math-into-latex' on page 11 undefined on input line 78
0.


LaTeX Warning: Citation `kopka03' on page 11 undefined on input line 780.


LaTeX Warning: Citation `latex-graphics' on page 11 undefined on input line 781
.

[11]

LaTeX Warning: Citation `knuth84' on page 12 undefined on input line 784.

No file paper.bbl.
[12] (./paper.aux)

LaTeX Warning: There were undefined references.

 )
(see the transcript file for additional information)
Output written on paper.dvi (12 pages, 35156 bytes).
Transcript written on paper.log.
latex paper.tex >&2  0.14s user 0.02s system 77% cpu 0.209 total

Thanks in advance!

closed as too broad by egreg, Joseph Wright Sep 7 '14 at 13:11

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Your OSX is 64 bit; is your Debian 32 bit? That could be one reason. However, your execution times are very small to draw definite conclusions. If you want to study this, I suggest that you try latex-ing something much longer and that you benchmark it properly, e.g., executing it many times repeatedly on both machines and taking the average execution time. – nickie Apr 3 '14 at 17:54
  • 2
    also what does kpsexpand '$TEXINPUTS' report on both systems? if /opt/local/share/texmf-texlive/ is not prefixed by !! in the OSX version then TeX has to search the file system for each file which can be slow, – David Carlisle Apr 3 '14 at 17:57
  • @DavidCarlisle coud you elaborate on that? I'm rather interested in this myself, since typesetting long documents using the subfile package feels somewhat slow. I'm on OS X as well using MacTex as my TeX-distro. – Argo Apr 3 '14 at 19:53
  • @Argo tex can prehash its search path using commands variously called texhash or mktexlsr it is basically just a recursive ls -lR file list, but searching the file is a lot quicker than making file system calls to search all the directory tree. !! in a search path means only consult the hashed file list never search the filesystem. Usually local directory and perhaps ~/texmf are not hashed so that files you just made are found, but if you have thousands of files in a tree without !! at the start of your path tex has to check that directory structure every time it looks for a file – David Carlisle Apr 3 '14 at 20:18
  • @nickie, The VM is 64bit. These times are quite consistent between runs, with maybe 10-20% variation. I would expect OSX to be at least as fast as a linux VM (and actually would expect it to be significantly faster). Also, I do have a kind-of benchmark - previewing latex fragments in org buffers in emacs is much slower on OSX. – Shwouchk Apr 3 '14 at 20:57

Browse other questions tagged or ask your own question.