[poppler] [PATCH v2 4/5] SplashXPathScanner: Reduce complexity of sorting spans
Adam Reichold
adam.reichold at t-online.de
Sat May 26 19:56:17 UTC 2018
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
> poppler at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/poppler
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/poppler/attachments/20180526/9fe3b8c3/attachment.sig>
More information about the poppler
mailing list