[poppler] [PATCH v2 4/5] SplashXPathScanner: Reduce complexity of sorting spans

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


On Samstag, 26. Mai 2018 21:02:07 CEST Adam Reichold wrote:
> Hello again,
> 
> you could try to initialize the SplashIntersection instances in place in
> addIntersection, i.e.
> 
> line.emplace_back();
> auto& intersection = line.back();
> // initialization
> 
> instead of
> 
> SplashIntersection intersection;
> // initialization
> line.push_back(intersection);
> 
> (I think the compiler might not be allowed to optimize copying the
> values from the stack into the vector due to exception safety in the
> case of allocation failure.)

This results in about 3% slowdown.

Kind regards,

Stefan


-- 
Stefan Brüns  /  Bergstraße 21  /  52062 Aachen
home: +49 241 53809034     mobile: +49 151 50412019
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/poppler/attachments/20180526/31f0d593/attachment.sig>


More information about the poppler mailing list