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.
Created attachment 6802 [details] [review] Patch as described in the bug
Applied this patch and got no noticeable improvement here.
Created attachment 8238 [details] [review] The patch i applied to head as of 28-12-2006
you meantion a "UGooString bug where re-allocation would only preserve half of the string." can you point exactly where that lies?
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.