[Poppler-bugs] [Bug 8115] New: ~4% speedup for PDF loading by means of Object string cache

bugzilla-daemon at annarchy.freedesktop.org bugzilla-daemon at annarchy.freedesktop.org
Sun Sep 3 13:19:41 PDT 2006


Please do not reply to this email: if you want to comment on the bug, go to    
       
the URL shown below and enter yourcomments there.     
   
https://bugs.freedesktop.org/show_bug.cgi?id=8115          
     
           Summary: ~4% speedup for PDF loading by means of Object string
                    cache
           Product: poppler
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: general
        AssignedTo: poppler-bugs at lists.freedesktop.org
        ReportedBy: kkowalczyk at gmail.com


Currently poppler free()s/malloc()s strings a lot. Many of those re-allocations
are done for strings in Object class. Attached patch improves that by a simple
custom allocator that caches N recently free()d strings and satisfies alloc()s
from that cache, avoiding free()/malloc() cycle. In my tests the cache is very
effective: even a small cache (16 strings) can satisfy >99% of all allocations
requests.

It also changes Object::name and Object::cmd to use GooString * instead of char
*, so that they can benefit from the cache.

It also tweaks GooString and UGooString a bit and fixes a UGooString bug where
re-allocation would only preserve half of the string.

In my tests I get 2-10% speedup on loading PDF, 4% being the most common.          
     
     
--           
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email         
     
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Poppler-bugs mailing list