# Including same PDF image many times: how to optimize?

I am include (with `graphicx`’s `\includegraphics`) the same small PDF vector graphics many many times in my LaTeX file, always at the same size. I then compile my document with `pdflatex`. While the size of the resulting PDF file is not an issue, it seems from the log file and my timing experiments that processing the PDF graphics so many times takes a lot of time, making my compilation slow. It seems something could be done, especially as the resulting object is always used at the same size.

So, what can I do to help `pdflatex` go faster?

-
`\documentclass[draft]...` usually helps a lot, especially with `graphicx` and `hyperref` –  cmhughes Oct 10 '12 at 21:24

possibly

``````\newbox\myimg
\savebox\myimg{\includegraphics....}
``````

.....

``````\usebox\myimg
``````

...

``````\usebox\myimg
``````
-
It works, but it saves very little time. Yet, if I put anything else in the box, it goes much faster. So, the issue may not be from reading the .pdf graphic file (as I thought), but from writing the object to the resulting PDF stream. Thanks in any case! –  F'x Oct 10 '12 at 21:04
actually my (dim) recollection was that if you reused includegraphics with the same arguments the pdftex driver would recycle the pdf object rather than re-processing, The file has got more complicated since the original but I think that is still the intention pdftex.def says `% mechanism for re-use of objects also % allows us to get the size by deriving it from the initial storage; % this works for all graphics types. %` –  David Carlisle Oct 10 '12 at 21:11