Am 26.05.2018 um 21:32 schrieb Stefan Brüns: > 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.
Surprised that it is that measurable. And of course, surprised that it is a slow down. :-) I guess this suggests the values come directly from registers instead of the stack when using push_back? > Kind regards, > > Stefan > > > > > _______________________________________________ > poppler mailing list > [email protected] > https://lists.freedesktop.org/mailman/listinfo/poppler >
signature.asc
Description: OpenPGP digital signature
_______________________________________________ poppler mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/poppler
