[texhax] Throughput

William Adams will.adams at frycomm.com
Fri Mar 4 15:18:10 CET 2011


On Mar 3, 2011, at 4:07 PM, Peter Davis wrote:

> Jonathan Kew suggested putting each graphic in a \box, and simplying copying the boxes where needed.  Does that actually eliminate redundant access to the external PDF files?  That would be great.

I just tried a short experiment w/ my Thanksgiving card file and judging from the log file, it does. I'll see if I can post the time it takes for the full file to run before the day is out.

Instead of \copy, I used LaTeX's save boxes though:

\newsavebox{\insidegraphic}
\newsavebox{\outsidegraphic}
\sbox{\outsidegraphic}{\includegraphics{outside.pdf}}
\sbox{\insidegraphic}{\includegraphics{image/inside.pdf}}

Which kind of begs the question could this functionality be built into \includegraphics directly?


> Also, William Adams mentioned that calling \fontspec can be very expensive, and I'm definitely doing that over and over again.  I guess there's a way to cache the font settings to eliminate a lot of that overhead when using the same font repeatedly.  (Unfortunately, when processing the XML, I have no way of knowing which is the 'normal' font for the document.)

All of this is documented in the Fontspec documentation --- you want to make one font instance for each font used (say in the pre-amble) then make use of said font instances in the body of the document. It would probably be okay in terms of processing time to have a single package file which instantiated instances for _all_ fonts you are planning on using, then load that package file.

William

-- 
William Adams
senior graphic designer
Fry Communications
Sphinx of black quartz, judge my vow.




More information about the texhax mailing list