[texhax] Throughput

William Adams will.adams at frycomm.com
Fri Mar 4 17:46:31 CET 2011


On Mar 4, 2011, at 10:42 AM, Heiko Oberdiek wrote:

> On Fri, Mar 04, 2011 at 09:18:10AM -0500, William Adams wrote:
> 
>> 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?
> 
> Some kind of optimizations are already build in, thus that the
> same image isn't embedded more than once (e.g. pdftex.def, the
> compiler itself might detect same images, ...). However the
> graphics package needs to find the file first and get the right
> file name:
>  \includegraphics{foobar}
>  \includegraphics{foobar.png}
> can be the same image or different images.
> But the same is also true for
>  \includegraphics{foobar}
>  \includegraphics{foobar}
> if they are executed at different settings of \graphicspath.
> Also box registers are a limited resource soon (vanilla TeX) or
> later (enabled e-TeX extensions) you will hit a limit.

I was afraid of something like that.

Will things be better in LuaTeX? Really, all one would need would be a list structure which one could check before loading a graphic to see if it had already been loaded --- add it to the list if not and it ``just works''.

William

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




More information about the texhax mailing list