From: graeme.russ@gmail.com (Graeme Russ)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How to measure performance inside Kernel?
Date: Sat, 11 Feb 2012 14:44:50 +1100 [thread overview]
Message-ID: <4F35E432.6060002@gmail.com> (raw)
In-Reply-To: <CA+MoWDr-7pAffmkC2YQfaZFU6u5ojstxHcKwJ8D6jPBd1HPyKA@mail.gmail.com>
Hi Peter,
On 02/11/2012 11:22 AM, Peter Senna Tschudin wrote:
> Jeff,
>
> Thanks for the fast reply. My goal is to determine if the code:
>
> /* * */
> buf_ptr_end = q->bufs[q->num_buffers];
>
> for (buf_ptr = q->bufs[0]; buf_ptr < buf_ptr_end; ++buf_ptr)
> buf_ptr->state = VB2_BUF_STATE_DEQUEUED;
> /* * */
>
> is faster than:
>
> /* * */
> for (i = 0; i < q->num_buffers; ++i)
> q->bufs[i]->state = VB2_BUF_STATE_DEQUEUED;
> /* * */
For starters, I would not be surprised if the compiler produces identical
code, and if not, code that has the same performance...
> 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,99,105,99,87,105,99,105,105,102,108,123,105,113,104,128,107,92,117,117,120,102,105,105,90,105,101,119,119,101,141,111,96,99,93,80,102,78,93,93,108,108,129,105,107,113,104,104,93,95,104,125,104,95,90,108,117,126,93,87,102,99,93,108,96,104,113,89,92,134,107,98,95,104,102,143,102,126,99,111,99,117,105,102,108,108,98,107,104,98,96,81,108,120,102,87,93,93,93,119,104,96,108,93,108,108,111,98,98,116,122,98,101,87,99,99,105,102,108,111,99,96,111,111,102,98,110,125,107,110,132,102,99,105,87,84,108,120,90,101,95,113,101,107,111,105,108,114,126,102,92,110,104,101,99,108,135,105,123,111,108,102,102,110,110,92,98,104,119,102,113,95,107,104,116,131,153,164,152,125,107,101,93,105,96,123,96,111,111,99,93,101,92,107,89,95,108,111,99,111,114,108,99,117,129,107,105,87,87,93,102,99,83,96,84,102,96,90,110,101,116,89,98,119,125,114,99,126,123,102,123,111,102,101,110,107,111,90,105,111,96,105,102,113,104,158,101,87,102,96,108,111,138,102,120,87,90,102,104,107,101,84,102,99,96,111,
99,105,102,99,104,131,116,104,104,105,126,105,116,128,107,101,105,120,132,111,90,90,114,99,86,110,95,81,120,96,126,99,108,114,120,102,120,125,95,104,96,108,105,105,114,123,111,93,104,83,113,107,99,99,99,105,90,78,119,113,98,98,90,99,90,129,96,101,110,77,110,125,101,102,87,87,117,126,117,108,126,108,96,108,99,105,105,114,123,104,104,110,105,84,96,105,96,120,111,120,101,110,110,87,105,114,102,87,108,135,117,132,141,105,113,95,98,84,96,87,98,89,108,105,102,99,99,105,126,99,101,92,98,75,102,102,129,102,99,102,99,108,92,110,125,107,110,102,96,96,117,72,108,123,105,120,120,99,120,98,104,89,102,117,129,123,105,119,107,101,87,117,111,99,108,117,114,114,90,122,113,95,104,125,113,102,108,120,90,108,93,89,86,87,90,84,83,108,99,102,90,108,90,108,87,95,86,90,123,135,93,126,93,102,99,123,108,117,105,102,105,98,107,122,119,125,96,108,131,99,114,104,93,96,95,83,99,84,92,87,
>
> The geometrical mean of the values is: 104.7623578604
>
> Isn't it enough?
That sounds like a perfectly good methodology - It would be interesting to
see how many reps are required before the mean settles down to a constant
value - Maybe you don't need to run it so many times, or maybe you need to
run more...
Regards,
Graeme
next prev parent reply other threads:[~2012-02-11 3:44 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 [this message]
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
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=4F35E432.6060002@gmail.com \
--to=graeme.russ@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.