Bug 8115 - ~4% speedup for PDF loading by means of Object string cache
Summary: ~4% speedup for PDF loading by means of Object string cache
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Windows (All)
: high normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-03 13:19 UTC by Krzysztof Kowalczyk
Modified: 2010-04-06 14:04 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch as described in the bug (28.83 KB, patch)
2006-09-03 13:20 UTC, Krzysztof Kowalczyk
Details | Splinter Review
The patch i applied to head as of 28-12-2006 (40.44 KB, patch)
2006-12-28 09:09 UTC, Albert Astals Cid
Details | Splinter Review

Description Krzysztof Kowalczyk 2006-09-03 13:19:41 UTC
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.
Comment 1 Krzysztof Kowalczyk 2006-09-03 13:20:02 UTC
Created attachment 6802 [details] [review]
Patch as described in the bug
Comment 2 Albert Astals Cid 2006-12-28 09:08:00 UTC
Applied this patch and got no noticeable improvement here.
Comment 3 Albert Astals Cid 2006-12-28 09:09:16 UTC
Created attachment 8238 [details] [review]
The patch i applied to head as of 28-12-2006
Comment 4 Albert Astals Cid 2006-12-28 09:13:17 UTC
you meantion a "UGooString bug where re-allocation would only preserve half of 
the string." can you point exactly where that lies?
Comment 5 Albert Astals Cid 2010-04-06 14:04:51 UTC
Closed, as far as i remember, this was kind of commited.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.