Bug 34005

Summary: splash patch to make pdftops 5% faster on some images
Product: poppler Reporter: William Bader <williambader>
Component: splash backendAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: williambader
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: splash patch to make pdftops 5% faster on some images

Description William Bader 2011-02-07 12:58:23 UTC
Created attachment 43045 [details] [review]
splash patch to make pdftops 5% faster on some images

I profiled pdftops by building with --disable-shared --enable-static and saw that pipeRun() and getPixel() were called a very large number of times.
This patch inlines specialized versions of pipeRun(pipe) in two common cases in drawSpan() and completes the inlining of getPixel() in blitTransparent().
The changes make "pdftops -level1sep -eps bug-poppler27482.pdf" (with the rasterization patches applied) run about 5% faster.
The changes should probably benefit all applications that use splash and not just pdftops.
Comment 1 Albert Astals Cid 2011-02-25 16:55:32 UTC
I'm not really convinced about the first part, you are "inlininig" only one of the 11 uses of pipeRun?
Comment 2 William Bader 2011-02-25 17:36:30 UTC
>I'm not really convinced about the first part, you are "inlininig" only one of
the 11 uses of pipeRun?

Thanks for looking at it.

I inlined two specific options of one place that lead to the most calls to pipeRun() in some of my test files that took the longest for pdftops to process.  I built pdftops with profiling and traced the locations of the calls.  It eliminated about half of the calls to pipeRun().  The remaining calls were from other locations or with options that would have required inlining the full logic of pipeRun().

William
Comment 3 Albert Astals Cid 2011-02-26 04:51:04 UTC
That might work for you but sincerely i don't see it happening in us only changing only 1 out of the 11 because it helped in some pdf files.

If you want something like this to be commited you have to find a way to "optimize" them all without the code becoming a mess.
Comment 4 William Bader 2011-02-26 05:53:16 UTC
>That might work for you but sincerely i don't see it happening in us

OK.  Can you take just the second part?
Do you want me to submit a new patch file?
William
Comment 5 Albert Astals Cid 2011-02-26 17:46:23 UTC
2nd part Commited to master
Comment 6 William Bader 2011-02-26 17:59:05 UTC
Thanks!

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.