[poppler] [PATCH v2 0/5] Optimize SplashXPath/SplashXPathScanner

Stefan Brüns stefan.bruens at rwth-aachen.de
Sat May 26 17:51:19 UTC 2018


The first 3 patches do some preparative cleanup/optimization.

The 4th patch contains the first part of the  optimization,
replacing the single intersections array with a better fitting
structure.

The 5th patch optionally uses boost::container::small_vector,
to reduce the number of allocations for common simple polygons.

For the documents from fdo#96728 and fdo#78728, the pdftoppm
runtime is significantly reduced (according to /usr/bin/time -v,
before / after patch 4 / after patch 5, in seconds):

runsforever-poppler:  2979.80 / 2348.08 (79%) / 1773.53 (60%)
surf-types:              9.45 /    7.76 (82%) /    5.02 (53%)

---
v2: split addition of boost::container::small_vector use into separate patch
    reserve space for 4 elements on first insertion
    updated benchmark results, add second document
    remove some no longer used variables
    fix signedness when comparing with vector<>::size()
Patches 1-3 are unchanged

Stefan Brüns (5):
  Splash: Reserve space for path segments upfront
  SplashXPathScanner: Reset span state explicitly when advancing line
  SplashXPathScanner: Clamp y range to yMin/yMax outside the loop
  SplashXPathScanner: Reduce complexity of sorting spans
  SplashXPathScanner: Optionally use small_vector from boost

 CMakeLists.txt               |  10 ++
 poppler/SplashOutputDev.cc   |   1 +
 splash/Splash.cc             |   9 ++
 splash/SplashPath.cc         |   4 +
 splash/SplashPath.h          |   3 +
 splash/SplashXPathScanner.cc | 264 +++++++++++++++++++------------------------
 splash/SplashXPathScanner.h  |  38 +++++--
 7 files changed, 169 insertions(+), 160 deletions(-)

-- 
2.16.3



More information about the poppler mailing list