From: michi1@michaelblizek.twilightparadox.com (michi1 at michaelblizek.twilightparadox.com)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How to measure performance inside Kernel?
Date: Sat, 11 Feb 2012 08:34:29 +0100 [thread overview]
Message-ID: <20120211073428.GB2232@grml> (raw)
In-Reply-To: <CA+MoWDr-7pAffmkC2YQfaZFU6u5ojstxHcKwJ8D6jPBd1HPyKA@mail.gmail.com>
Hi!
On 22:22 Fri 10 Feb , Peter Senna Tschudin wrote:
...
> I'm measuring the running time of that portion of code 512 times. Then
> calculate the geometrical mean of results. See one output example:
>
> Original_code:,
> 514,110,92,104,107,101,101,
...
> The geometrical mean of the values is: 104.7623578604
>
> Isn't it enough?
It should reduce the influence of the scheduler, but you can see a different
effect here: The first run takes ~5 times longer than any run which follows.
This is most likely caused by CPU cache effects. The question is now whether
you can expect the data to be in the cpu cache when this code is run in the
real world. If not, you might want to add prefetch instructions (look for
"__builtin_prefetch"). These instructions will make the first run faster, but
further runs slower.
-Michi
--
programing a layer 3+4 network protocol for mesh networks
see http://michaelblizek.twilightparadox.com
next prev parent reply other threads:[~2012-02-11 7:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-09 12:58 How to measure performance inside Kernel? Peter Senna Tschudin
2012-02-09 18:12 ` michi1 at michaelblizek.twilightparadox.com
2012-02-10 21:47 ` Peter Senna Tschudin
2012-02-10 22:06 ` Jeff Haran
2012-02-11 0:22 ` Peter Senna Tschudin
2012-02-11 3:44 ` Graeme Russ
2012-02-11 13:14 ` Peter Senna Tschudin
2012-02-11 13:57 ` Peter Senna Tschudin
2012-02-12 11:46 ` Mulyadi Santosa
2012-02-13 23:13 ` Peter Senna Tschudin
2012-02-14 3:43 ` Mulyadi Santosa
2012-02-11 7:34 ` michi1 at michaelblizek.twilightparadox.com [this message]
2012-02-11 7:22 ` michi1 at michaelblizek.twilightparadox.com
2012-02-11 13:29 ` Peter Senna Tschudin
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=20120211073428.GB2232@grml \
--to=michi1@michaelblizek.twilightparadox.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/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).