From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFONN-0004ws-3m for qemu-devel@nongnu.org; Thu, 07 Aug 2014 10:09:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XFONG-0007ao-V9 for qemu-devel@nongnu.org; Thu, 07 Aug 2014 10:09:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23303) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFONG-0007ak-O0 for qemu-devel@nongnu.org; Thu, 07 Aug 2014 10:08:58 -0400 Date: Thu, 7 Aug 2014 16:08:53 +0200 From: Kevin Wolf Message-ID: <20140807140853.GD3374@noname.redhat.com> References: <1407317621-30591-1-git-send-email-pbonzini@redhat.com> <20140807093320.GB32038@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/WwmFnJnmDyWGHa4" Content-Disposition: inline In-Reply-To: <20140807093320.GB32038@stefanha-thinkpad.redhat.com> Subject: Re: [Qemu-devel] [PATCH] test-coroutine: add baseline test that times the cost of function calls List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Paolo Bonzini , ming.lei@canonical.com, qemu-devel@nongnu.org --/WwmFnJnmDyWGHa4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. > >=20 > > For example, here are the results on my machine: > >=20 > > 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 > >=20 > > 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: > >=20 > > (8.445064 - 0.173884) * 10^9 / 100000000 =3D 82.7 > > (0.098445 * 100 - 0.173884) * 10^9 / 100000000 =3D 96.7 > > (7.406431 * 10 - 0.173884) * 10^9 / 100000000 =3D 738.9 > >=20 > > Signed-off-by: Paolo Bonzini > > --- > > tests/test-coroutine.c | 24 ++++++++++++++++ > > 1 files changed, 24 insertions(+) >=20 > Can't hurt to have this as a comparison. >=20 > Reviewed-by: Stefan Hajnoczi Thanks, applied to the block branch. Kevin --/WwmFnJnmDyWGHa4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJT44h1AAoJEH8JsnLIjy/WdJEP/jmM+Q/ocCV/zyTCM4zDA5Ax Hl2irN1lXydWjyyK1TDq6gsIleBs41m1V4QPy1vH3RKPpr6j2839DnOSLU7hipwy JhOqYy7Q8m5nD0Vctyge0T6RWln3frm0Fiy3S7mT7ddaPYFjOiO2oIQriADBW+dr A5rEqvjOEmq7B9cvto9IYbDkhvBQ63BeM2X8W1u1uzqgsLtzvx4LwjrycXdrtcH4 fgidQCA3xj6HU8OXiyy01zm8AIMnZ6Eq9cbnigr7GBp06cEtFjjHyw80zltEcHsq dIwn/3o57jY1yBQTpojZE/OdG+Mx7AkHzBF+roieMFHlhcvOeT8kwyPegcxFINI7 qq0DvfCoGtbEw5oyMo+uIYHcl7p/PHG0D4+0yjzhObsYuQNc3AcemVvycDCaI9I8 iV2ioDAYs9QbAslzQePHQuRR8IIwNQv0irjFZ41SUcnIgdpJVRg3G/7YTKxK69CW DSOmx3pX2D4wHlotsood8q3JsMA7+2vYqDHsDa5IIXi17KuRjE0TO6Z0MEtrXrMQ 4J8y2EdTpUZO5sGqbZKkTgaq32LGNEhOidBp14Nn+wR4cDXb9z7Gvp0Kh5qz7la9 KRC0XMeXy9pRFtW3fSyaQmlr377bkir7nzyTX5yTP/Im8dUurtCOCJGEYKPUrDzT 6NT0ngcUOYSr2ZvxfM0J =TQjt -----END PGP SIGNATURE----- --/WwmFnJnmDyWGHa4--