mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "Daniel Cegiełka" <daniel.cegielka@gmail.com>
To: musl@lists.openwall.com
Cc: John Mudd <johnbmudd@gmail.com>
Subject: Re: musl perf, 20% slower than native build?
Date: Thu, 9 Apr 2015 08:50:24 +0200	[thread overview]
Message-ID: <CAPLrYERP1DO=rfneK+m3dMo+E+AcJrzbjXAry8-r3EZzLqPKiQ@mail.gmail.com> (raw)
In-Reply-To: <CAKHv7phN-3SkKW12q7YRzUdzG94Dp8EQ=sZFS+8hFiZ5+c04yw@mail.gmail.com>

2015-04-08 22:59 GMT+02:00 Paul Schutte <sjpschutte@gmail.com>:
> Hi Daniel,
>
> Pardon my stupidity, but with what did you replace the memcpy ?

I use memcpy more suited to my CPU. memcpy latency was very important
for me because it had a big impact on the total latency (in my code).
I suppose that most of the problems with latency will have its cause
in musl's memcpy. This is quite a complex topic, because the memcpy's
optimal code depends on how large blocks of memory will be copied.
Sometimes faster will be SSE2 and sometimes AVX2, but heavily
optimized code is not portable (eg AVX2) and this is a problem. Fast
memcpy implementations usualy uses CPUID to choose the right code, but
such code is blown and ugly.

Daniel


> Regards
> Paul
>
> On Wed, Apr 8, 2015 at 9:28 PM, Daniel Cegiełka <daniel.cegielka@gmail.com>
> wrote:
>>
>> 2015-04-08 21:10 GMT+02:00 John Mudd <johnbmudd@gmail.com>:
>>
>> > Here's output from perf record/report for libc. This looks consistent
>> > with
>> > the 5% longer run time.
>> >
>> > native:
>> >      2.20%   python  libc-2.19.so         [.] __memcpy_ssse3
>>
>> >
>> > musl:
>> >      4.74%   python  libc.so              [.] memcpy
>>
>> I was able to get twice speed-up (in my code) just by replacing memcpy
>> in the musl.
>>
>> Daniel
>
>


  reply	other threads:[~2015-04-09  6:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08 15:33 John Mudd
2015-04-08 15:58 ` Alexander Monakov
2015-04-08 16:05 ` Szabolcs Nagy
2015-04-08 19:10   ` John Mudd
2015-04-08 19:28     ` Daniel Cegiełka
2015-04-08 20:59       ` Paul Schutte
2015-04-09  6:50         ` Daniel Cegiełka [this message]
2015-04-09 17:28         ` Execinfo.h, backtrace is needed Jean-Marc Pigeon
2015-04-09 17:34           ` Rich Felker
2015-04-09 17:57             ` Alexander Monakov
2015-04-10 14:30               ` Jean-Marc Pigeon
2015-04-08 19:33     ` musl perf, 20% slower than native build? Alexander Monakov
2015-04-08 20:16       ` John Mudd
2015-04-08 20:24         ` John Mudd
2015-04-08 21:48           ` John Mudd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPLrYERP1DO=rfneK+m3dMo+E+AcJrzbjXAry8-r3EZzLqPKiQ@mail.gmail.com' \
    --to=daniel.cegielka@gmail.com \
    --cc=johnbmudd@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).