[poppler] [PATCH] no big deal

Krzysztof Kowalczyk kkowalczyk at gmail.com
Thu Aug 31 19:20:53 PDT 2006

On 8/31/06, Rafael Rodríguez <rafael.rodriguez.tf at gmail.com> wrote:
> this patch just saves some operations by taking them outside of the tiling
> loop in patterns. It's no big deal actually, but in big loops can save a lot
> of calls.
> I haven't taken any timing measure (any ideas for this...?), but i think the
> benefits are pretty straightforward.

The only way to really know if your changes make any difference is to
profile the code. When I tried my hands at improving poppler speed, I
was rather surprised at which part were expensive

Even more importantly, profiler will tell you  which parts of the code
take the biggest amount of time and hence are most worth optimizing.

I haven't profiled on Unix but I've heard good things about valgrind

For measuring speed gains I use a small program that I wrote called
pdftest. You can get it as part of my poppler copy in sumatra
(http://blog.kowalczyk.info/software/sumatrapdf/develop.html), in
directory poppler\test. It compiles under Unix but you'll have to
write a makefile and add a file that implements  3 functions:
extern void PreviewBitmap_Init(void);
extern void PreviewBitmap(SplashBitmap *);
extern void PreviewBitmap_Destroy(void);
(can be dummies, only used if you want visual preview, you can see
PdftestWinPreview.cc for example of implementation).

Test program can measure loading time of the whole PDF and rendering
of each page. I run it to verify that I've actually made some speedups
(I usually run it 10 times on the same PDF and use an average time,
after rejecting times that differ too much from average).

-- kjk | http://blog.kowalczyk.info

More information about the poppler mailing list