All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	ming.lei@canonical.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] test-coroutine: add baseline test that times the cost of function calls
Date: Thu, 7 Aug 2014 16:08:53 +0200	[thread overview]
Message-ID: <20140807140853.GD3374@noname.redhat.com> (raw)
In-Reply-To: <20140807093320.GB32038@stefanha-thinkpad.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1362 bytes --]

Am 07.08.2014 um 11:33 hat Stefan Hajnoczi geschrieben:
> On Wed, Aug 06, 2014 at 11:33:41AM +0200, Paolo Bonzini wrote:
> > This can be used to compute the cost of coroutine operations.  In the
> > end the cost of the function call is a few clock cycles, so it's pretty
> > cheap for now, but it may become more relevant as the coroutine code
> > is optimized.
> > 
> > For example, here are the results on my machine:
> > 
> >    Function call 100000000 iterations: 0.173884 s
> >    Yield 100000000 iterations: 8.445064 s
> >    Lifecycle 1000000 iterations: 0.098445 s
> >    Nesting 10000 iterations of 1000 depth each: 7.406431 s
> > 
> > One yield takes 83 nanoseconds, one enter takes 97 nanoseconds,
> > one coroutine allocation takes (roughly, since some of the allocations
> > in the nesting test do hit the pool) 739 nanoseconds:
> > 
> >    (8.445064 - 0.173884) * 10^9 / 100000000 = 82.7
> >    (0.098445 * 100 - 0.173884) * 10^9 / 100000000 = 96.7
> >    (7.406431 * 10 - 0.173884) * 10^9 / 100000000 = 738.9
> > 
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > ---
> >  tests/test-coroutine.c | 24 ++++++++++++++++
> >  1 files changed, 24 insertions(+)
> 
> Can't hurt to have this as a comparison.
> 
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

Thanks, applied to the block branch.

Kevin

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2014-08-07 14:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-06  9:33 [Qemu-devel] [PATCH] test-coroutine: add baseline test that times the cost of function calls Paolo Bonzini
2014-08-07  9:33 ` Stefan Hajnoczi
2014-08-07 14:08   ` Kevin Wolf [this message]
2014-08-11  0:44 ` Ming Lei
2014-08-11 10:08 ` Ming Lei

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=20140807140853.GD3374@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=ming.lei@canonical.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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 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.