The first 2 patches do some preparative cleanup/optimization.
The 3rd patch contains the first part of the optimization, replacing the single intersections array with a better fitting structure.
The 4th patch optionally uses boost::container::small_vector, to reduce the number of allocations for common simple polygons.
Patches 5 to 6 to some straight forward optimizations, moving invariant code out of the loops.
For the documents from fdo#96728 and fdo#78728, the pdftoppm runtime is significantly reduced (according to /usr/bin/time -v, before / after patch 3 / after patch 4, in seconds):
runsforever-poppler: 2979.8 / 2348.1 (79%) / 1773.5 (60%) surf-types: 9.45 / 7.76 (82%) / 5.02 (53%)
After patch 5 / 7: runsforever-poppler: 1442.0 (48%) / 1239.0 (42%) surf-types: 5.02 (53%) / 4.70 (49%)
This is version 3 of the patches. This merge request has been sent earlier as a series of 8 patches. The first patch was already merged. The former 2nd patch has been replaced by a different approach. The remainder is unchanged save any rebasing.