[poppler] [PATCH] Custom memory allocator to improve loading time by ~25%

Albert Astals Cid aacid at kde.org
Fri Aug 18 04:27:55 PDT 2006


A Divendres 18 Agost 2006 07:42, Krzysztof Kowalczyk va escriure:
> Hello,
>
> As I've mentioned previously, memory allocations (malloc()/free()
> calls) account for a lot of time used by poppler.
>
> Custom memory allocator uses free lists and allocates memory in chunks for
> the most frequently allocated memory sizes (in my testing about 90% of
> allocations are served by the 4 sizes covered by the patch).
>
> The code is optional and only used when USE_FAST_ALLOC symbol is defined so
> it can be easily turned on and off.
>
> In my testing with this patch loading ~8MB pdf file (PDFReference1.6.pdf
> available from Adobe website)is speed up by ~25% (this is on top of my
> previous optimizations; improvement should be even better against current
> poppler CVS sources).
>
> Code is copiously commented and the algorithm used rather simple.
>
> The good part is that it hooks things at a very low level so no
> changes in actual poppler logic was necessary.
>
> This is bug https://bugs.freedesktop.org/show_bug.cgi?id=7910
>
> When combined with my other performance patch
> https://bugs.freedesktop.org/show_bug.cgi?id=7808, the loading time of
> my test document drops almost in half.
>
> I think I can improve this even further by optmizing Lexer::getChar()

Hi Krzysztof thanks for the cool work you are doing, i'm going tomorrow on 
holidays and will not have time to test and commit all your patches but i'm 
with Jeff that those patches should be applied if noone finds anything wrong 
in them.

Albert

>
> -- kjk | http://blog.kowalczyk.info
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler


More information about the poppler mailing list