caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alain Frisch <alain@frisch.fr>
To: John Carr <jfc@MIT.EDU>, ygrek <ygrekheretix@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] ackermann microbenchmark strange results
Date: Wed, 24 Apr 2013 18:08:00 +0200	[thread overview]
Message-ID: <51780360.3020607@frisch.fr> (raw)
In-Reply-To: <201304241557.r3OFvT9a012995@outgoing.mit.edu>

+1

I've already seen 20% speedup obtained by adding some dead code (in an 
OCaml program, but this is irrelevant).

-- Alain

On 04/24/2013 05:57 PM, John Carr wrote:
> Try changing loop alignment by editing assembly code.  The address of
> ack is different in the different versions.  Modern Intel processors are
> sensitive to code alignment.  There is a limit on the number of branch
> prediction table entries per cache line.  An instruction that crosses a
> cache line boundary may be slower than an instruction within a cache
> line.  I am not surprised to see a 20% difference caused by an apparently
> irrelevant code change.
>
>> Moreover, the generated assembly code for the main loop is the same, afaics. The only
>> difference is the initialization of structure fields and the initial call to ack. Please can anybody
>> explain the performance difference? I understand that microbenchmarks are no way the basis to draw
>> performance conclusions upon, but I cannot explain these results to myself in any meaninful way.
>> Please help! :)
>


  reply	other threads:[~2013-04-24 16:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-24 10:35 ygrek
2013-04-24 15:57 ` John Carr
2013-04-24 16:08   ` Alain Frisch [this message]
2013-04-24 16:57     ` Anthony Tavener
2013-04-24 17:26     ` rixed
2013-04-24 17:31       ` Török Edwin
2013-04-24 17:35   ` Matteo Frigo
2013-04-26  3:31   ` ygrek
2013-04-24 17:40 ` Xavier Leroy

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=51780360.3020607@frisch.fr \
    --to=alain@frisch.fr \
    --cc=caml-list@inria.fr \
    --cc=jfc@MIT.EDU \
    --cc=ygrekheretix@gmail.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.
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).