Received: from eggs.gnu.org ([2001:4830:134:3::10]:47909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJi46-0002eQ-OA for qemu-devel@nongnu.org; Mon, 27 Jul 2015 09:03:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJi42-0007nY-E4 for qemu-devel@nongnu.org; Mon, 27 Jul 2015 09:03:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47698) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJi42-0007nS-8v for qemu-devel@nongnu.org; Mon, 27 Jul 2015 09:03:30 -0400 From: Markus Armbruster References: <507c11db2c97eef33de0e4f7168076d5c39f0867.1436866326.git.p.fedin@samsung.com> Date: Mon, 27 Jul 2015 15:03:26 +0200 In-Reply-To: <507c11db2c97eef33de0e4f7168076d5c39f0867.1436866326.git.p.fedin@samsung.com> (Pavel Fedin's message of "Tue, 14 Jul 2015 12:39:01 +0300") Message-ID: <87r3ntzra9.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v4 2/2] QOM: object_property_add() performance improvement List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Fedin Cc: Paolo Bonzini , Peter Crosthwaite , qemu-devel@nongnu.org, Andreas =?utf-8?Q?F=C3=A4rber?= Pavel Fedin writes: > Avoid repetitive lookup of every property in array starting from 0 by adding > one more property which caches last used index. Every time an array is > expanded the index is picked up from this cache. > > The property is a uint32_t and its name is name of the array plus '#' > ('name#'). It has getter function in order to allow to inspect it from > within monitor. Do we really want '#' in property names? Elsewhere, we require names to be id_wellformed(). I've long argued for doing that consistently[*], but QOM still doesn't. I've always hated "automatic arrayification", not least because it encodes semantics in property names. I tried to replace it[**], but Paolo opposed it. Which makes him the go-to guy for reviewing anything that touches it ;-P [*] http://lists.gnu.org/archive/html/qemu-devel/2014-10/msg00030.html [**] http://lists.gnu.org/archive/html/qemu-devel/2014-10/msg00030.html