mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: Denys Vlasenko <vda.linux@googlemail.com>
Cc: musl <musl@lists.openwall.com>
Subject: Re: [PATCH] x86_64/memset: use "small block" code for blocks up to 30 bytes long
Date: Tue, 17 Feb 2015 12:40:45 -0500	[thread overview]
Message-ID: <20150217174045.GH23507@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAK1hOcOaN4SnpO2jMGib3tFEf+c8=Tu8Nwi2YnOhzefpSSqTng@mail.gmail.com>

On Tue, Feb 17, 2015 at 05:51:11PM +0100, Denys Vlasenko wrote:
> On Tue, Feb 17, 2015 at 5:12 PM, Rich Felker <dalias@libc.org> wrote:
> > On Tue, Feb 17, 2015 at 02:08:52PM +0100, Denys Vlasenko wrote:
> >> >> Please see attached file.
> >> >
> >> > I tried it and it's ~1 cycle slower for at least sizes 16-30;
> >> > presumably we're seeing the cost of the extra compare/branch at these
> >> > sizes but not at others. What does your timing test show?
> >>
> >> See below.
> >> First column - result of my2.s
> >> Second column - result of vda1.s
> >>
> >> Basically, the "rep stosq" code path got a bit faster, while
> >> small memsets stayed the same.
> >
> > Can you post your test program for me to try out? Here's what I've
> > been using, attached.
> 
> With your program I see similar results:
> 
> ....
> size 50: min=10, avg=10           min=10, avg=10
> size 52: min=10, avg=10           min=10, avg=10

The ... was the part where mine seemed better. :)

Anyway thanks; I'll give your test program a run and see what comes
out. I don't think the difference is going to be big either way, but I
suspect mine is slightly faster for small sizes (~1-30) and slightly
slower for large sizes (>126).

BTW I appreciate your work and interest in improving this. I just
don't like string-ops optimization in general because determining that
changes are actually a net gain for a wide range of cpus and usage
cases and not just for one benchmark turns into a big time sink. :-(
But at least it's fun...

Rich


  parent reply	other threads:[~2015-02-17 17:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-13 16:39 Denys Vlasenko
2015-02-14 19:35 ` Rich Felker
2015-02-15  4:06   ` Rich Felker
2015-02-15 14:07     ` Denys Vlasenko
2015-02-15 15:03       ` Rich Felker
2015-02-15 21:44         ` Denys Vlasenko
2015-02-15 22:55           ` Rich Felker
2015-02-16 10:09             ` Denys Vlasenko
2015-02-16 15:12               ` Rich Felker
2015-02-16 17:36           ` Rich Felker
2015-02-17 13:08             ` Denys Vlasenko
2015-02-17 16:12               ` Rich Felker
2015-02-17 16:51                 ` Denys Vlasenko
2015-02-17 17:30                   ` Denys Vlasenko
2015-02-17 17:40                   ` Rich Felker [this message]
2015-02-17 18:53                     ` Denys Vlasenko
2015-02-17 21:12                       ` Rich Felker
2015-02-18  9:05                         ` Denys Vlasenko

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=20150217174045.GH23507@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    --cc=vda.linux@googlemail.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).