From: John Carr <jfc@MIT.EDU>
To: ygrek <ygrekheretix@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] ackermann microbenchmark strange results
Date: Wed, 24 Apr 2013 11:57:29 -0400 [thread overview]
Message-ID: <201304241557.r3OFvT9a012995@outgoing.mit.edu> (raw)
In-Reply-To: <20130424183543.e3a4290382f7f9ce7b522a57@gmail.com>
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! :)
next prev parent reply other threads:[~2013-04-24 15:57 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 [this message]
2013-04-24 16:08 ` Alain Frisch
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=201304241557.r3OFvT9a012995@outgoing.mit.edu \
--to=jfc@mit.edu \
--cc=caml-list@inria.fr \
--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).