[poppler] More poppler speedups
Jeff Muizelaar
jeff at infidigm.net
Sat Sep 2 18:06:42 PDT 2006
On Sat, Sep 02, 2006 at 05:31:17PM -0700, Krzysztof Kowalczyk wrote:
> Hello,
>
> I've made more progress in my quest for improving performance of poppler.
>
I should have some time this week to look at and hopefully commit this stuff.
> I think there are more opportunities for improvements like 2) although
> even more improvements would come from improving various
> Stream::getChar() methods (currently Lexter::getChar(),
> EmbedStream::getChar() and FlateStream::getChar() are in top 5 of most
> exensive methods during loading. I haven't yet found a way to improve
> that.
One of the ways that I looked at optimizing these was by adding a read()
method to the Stream class that reads multiple bytes instead of a single
one. I have a patch from a long time ago that adds something like this
at:
http://people.freedesktop.org/~jrmuizel/patches/poppler-read-stream.patch
The problem I ran into was with things like inline images (EmbedStream).
With these streams there is no way of knowing ahead of time how long the
stream is so you have to be very careful not read more than you are
supposed to. This is also the source of the current problem with the
zlib based version of FlateStream.
The solution, it seems, is just to be careful not to read more than 1
byte when the stream does not have a limited length. I have a patch
around that fixes the zlib-based FlateStream to only read as much as it
needs so the read() method should be feasible. This should help drop the
FlateStream::getChar() overhead as long as it isn't reading from an
EmbedStream.
-Jeff
More information about the poppler
mailing list