From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFK4h-0005nz-Se for qemu-devel@nongnu.org; Thu, 07 Aug 2014 05:33:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XFK4b-00036Z-Ms for qemu-devel@nongnu.org; Thu, 07 Aug 2014 05:33:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFK4b-00034a-F4 for qemu-devel@nongnu.org; Thu, 07 Aug 2014 05:33:25 -0400 Date: Thu, 7 Aug 2014 10:33:20 +0100 From: Stefan Hajnoczi Message-ID: <20140807093320.GB32038@stefanha-thinkpad.redhat.com> References: <1407317621-30591-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KFztAG8eRSV9hGtP" Content-Disposition: inline In-Reply-To: <1407317621-30591-1-git-send-email-pbonzini@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: Paolo Bonzini Cc: kwolf@redhat.com, ming.lei@canonical.com, qemu-devel@nongnu.org --KFztAG8eRSV9hGtP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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(+) Can't hurt to have this as a comparison. Reviewed-by: Stefan Hajnoczi --KFztAG8eRSV9hGtP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEbBAEBAgAGBQJT40fgAAoJEJykq7OBq3PIigkH90dqKmE0q4VYBcwjLM/RKEuV Nv/osPrMfjd+xiML5b1I909BokONdr2oESa9kwka85ybSxk3YDOcqo/acjAcdljF 53GsVzqTv/UXBf/0yjv/E3JyJ+H/TK7h/Ad8a5xoDp+eX9Lmb0WsYOGH58JMXv6s nDN/17FBlO3vBjGqo4Hm63HDuJPIppbBOqSI4Cli/BNca5lp7pQgGSdYWsViXsr8 ChcPrzAWMZfINbfmvemhYAk7jyTKZ3by388Glr/7CWaG3UM55JkuCVdEgwrQfYIK BeQBN3NYEQWBYaj/p7AbYEIF6kU/mks8vEL3GHkn+36Nl8Ffci3c5zYXZF1EAw== =Vsi3 -----END PGP SIGNATURE----- --KFztAG8eRSV9hGtP--