[pdftex] Speeding up PDFLaTeX by skipping file inclusion

Kevin Dezfulian catch22 at fastmail.fm
Fri May 16 01:41:39 CEST 2003

Thanks to all for the replies.  Some further results:

On Thu, 15 May 2003 10:20:21 +0200, "Heiko Oberdiek"
<oberdiek at uni-freiburg.de> said:
> Not meantioned in the thread so far: you can try a smaller
> compression factor (\pdfcompresslevel=0 or \pdfcompresslevel=1)
> for the runs except the final one.

Hadn't thought of that!  Tried it out.  Did make a difference
(~10% per run of pdftex).  Will have to script that in.

On Thu, 15 May 2003 07:29:25 +0100, "Robin Fairbairns"
<Robin.Fairbairns at cl.cam.ac.uk> said:
> [you could run] all but the final round with
>   pdflatex \\PassOptionsToClass{draft}{myclass} \\input{myfile}
> but pdflatex is still noticeably slower than latex.

What surprises me is that with \usepackage[draft]{graphicx} pdftex
still reads the file (and then outputs a box!).  There's no speed 
difference between final and draft options (Robin's suggestion).
In comparison, LaTeX only looks at the eps bounding box and dvips is 
very fast when it realizes there's just a box to print.

Could this be a problem with the pdftex driver in the graphics package?
I don't see how.  Here's the part in graphics.sty dealing with draft or
(from \def\Gin at setfile#1#2#3{% . . .)
  \ifGin at draft
      \hb at xt@\Gin at req@width{%
        \vbox to \Gin at req@height{%
           \hrule \@width \Gin at req@width
           \rlap{ \ttfamily\expandafter\strip at prefix\meaning\@tempa}%
    \ProvidesFile{#3}[Graphic file (type #1)]%
    \setbox\z@\hbox{\csname Ginclude@#1\endcsname{#3}}%
    \ht\z@\Gin at req@height
    \wd\z@\Gin at req@width

Looks to me like the output driver (pdftex or dvips) would see nothing
but a box with text in it.  I found no mention of the word "draft" in
graphics driver file (.def).  And taking a look at the log files with
turned on: latex never even mentions the graphics files while pdftex has
them all there (and took longer digesting the bigger ones).

I'm perplexed.
  catch22 at fastmail.fm

http://www.fastmail.fm - Choose from over 50 domains or use your own

More information about the pdftex mailing list