[poppler] Image optimization

Kristian Høgsberg krh at bitplanet.net
Thu May 19 10:54:25 PDT 2005


I've been looking into optimizing the slow image handling in poppler.
As Jeff identifier earlier on, the color space conversion (surprisingly)
is taking a lot of time.  Here's a patch that adds a getRGBLine()
function to the color space object so we avoid a virtual function call
per pixel, plus it converts to bytes instead of doubles in the 0-1
range.  With this, the color space conversion disappears from the
profile while maintaining the full generality of the color space
conversion code.

I'm thinking about adding an output format type to getRGBLine() so it
would support a number of output format, specifically one that can be
used directly with cairo.  Other than that, I'm pretty happy with this
approach, here's some numbers:

	slow.pdf		23.6s	6.5s
	p59_1.pdf		17.5s	3.9s
	01-tifa's theme.pdf	8.7s	3.1s
	camj43004ind.pdf	9.9s	2.3s

It's still not really fast, but at this point we're hitting libpixman's
pixman_compositeGeneral at 72% (in one of the test documents).  That
function is pretty slow, so that we we're able to trump that in the
profile says something about how slow the current color space conversion
code is.

I'll commit this in a day or two when I've filled out the missing parts
(e.g. indexed color spaces).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: image-speedup.patch
Type: text/x-patch
Size: 12427 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/poppler/attachments/20050519/ae888f0b/image-speedup-0001.bin

More information about the poppler mailing list