From: Denis Vlasenko <vda@ilport.com.ua>
To: Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Matt Mackall <mpm@selenic.com>
Subject: Re: [PATCH] reduce inlined x86 memcpy by 2 bytes
Date: Fri, 18 Mar 2005 12:07:32 +0200 [thread overview]
Message-ID: <200503181207.32659.vda@ilport.com.ua> (raw)
In-Reply-To: <200503181121.42809.vda@port.imtp.ilyichevsk.odessa.ua>
On Friday 18 March 2005 11:21, Denis Vlasenko wrote:
> This memcpy() is 2 bytes shorter than one currently in mainline
> and it have one branch less. It is also 3-4% faster in microbenchmarks
> on small blocks if block size is multiple of 4. Mainline is slower
> because it has to branch twice per memcpy, both mispredicted
> (but branch prediction hides that in microbenchmark).
>
> Last remaining branch can be dropped too, but then we execute second
> 'rep movsb' always, even if blocksize%4==0. This is slower than mainline
> because 'rep movsb' is microcoded. I wonder, tho, whether 'branchlessness'
> wins over this in real world use (not in bench).
>
> I think blocksize%4==0 happens more than 25% of the time.
s/%4/&3 of course.
--
vda
next prev parent reply other threads:[~2005-03-18 10:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-18 9:21 Denis Vlasenko
2005-03-18 10:07 ` Denis Vlasenko [this message]
2005-03-20 13:17 ` Adrian Bunk
2005-03-22 6:40 ` Denis 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=200503181207.32659.vda@ilport.com.ua \
--to=vda@ilport.com.ua \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
--cc=vda@port.imtp.ilyichevsk.odessa.ua \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome