Allocation (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
Code is copiously commented and the algorithm used rahter simple.
Created attachment 6590 [details] [review]
custom memory allocator
A custom memory allocator is something i don't want to use, there's much more lower hanging fruit out there than a custom memory allocator.
on Aug 27, 2016 at 09:51:34.
(provided by the Example extension).