From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ubzly-0008G6-Rw for qemu-devel@nongnu.org; Mon, 13 May 2013 16:55:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ubzlx-0008Lz-RP for qemu-devel@nongnu.org; Mon, 13 May 2013 16:55:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ubzlx-0008LL-KH for qemu-devel@nongnu.org; Mon, 13 May 2013 16:55:05 -0400 Message-ID: <51915319.4090801@redhat.com> Date: Mon, 13 May 2013 22:54:49 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1368477106-7579-1-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1368477106-7579-1-git-send-email-aliguori@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-1.5 1/2] qom: aggressively optimize qom casting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, Aurelien Jarno , Andreas Faerber Il 13/05/2013 22:31, Anthony Liguori ha scritto: > This patch adds a small typename cache to ObjectClass. This allows > caching positive casts within each ObjectClass. Benchmarking a > PPC workload provided by Aurelien, this patch eliminates every > single g_hash_table_lookup() happening during the benchmark (which > was about 2 million per-second). > > With this patch applied, I get exactly the same performance (within > the margin of error) as with --disable-qom-cast-debug. > > N.B. it's safe to cache typenames only from the _assert() macros > because they are always called with string literals. Nice! Perhaps (for 1.6?) we can cache other results than class, so that interfaces are sped up as well. Reviewed-by: Paolo Bonzini