[libcxx-commits] [PATCH] D63063: Bug 42208: speeding up std::merge

Denis Yaroshevskiy via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 11 16:46:21 PDT 2019


dyaroshev added a comment.

In D63063#1536895 <https://reviews.llvm.org/D63063#1536895>, @lebedev.ri wrote:

> > Binary size increase (godbolt: https://godbolt.org/z/b1ZFTA):
> >  For std::string the size grows from 394 assembly instructions to 465 instructions (18%).
> >  For int - from 62 to 64 (3%).
>
> Uhm.
>  I have a question:
>  you did notice that you are looking at libstdc++ implementation there?
>  https://godbolt.org/z/WGSQ6r


My bad - keep forgetting about that by default libstdc++ is used.
Performance measurements were done using libc++ benchmarks and the results are correct.
Quickbench link is also good

Seems like libstdc++ does smth weird for coping strings, which leads to doubling of the size.

Binary size, std::string: 125 vs 184 (40%) - (much less than std::merge on libstdc++, which is 384)

  int            : 54 vs 64  (18%)

Seems like since the copy produces less code, my collapsing of two memmoves into one brings less size decrease.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63063/new/

https://reviews.llvm.org/D63063





More information about the libcxx-commits mailing list