[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 2/2] QOM: object_property_add() performance i

From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH v4 2/2] QOM: object_property_add() performance improvement
Date: Mon, 27 Jul 2015 14:23:32 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Jul 27, 2015 at 03:03:26PM +0200, Markus Armbruster wrote:
> Pavel Fedin <address@hidden> 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

Yeah, I think the magic arrayification behaviour is pretty unpleasant.
It feels like a poor hack to deal with fact that we've not got support
for setting non-scalar properties. Since we're representing arrays
implicitly, we have in turned created the performance problem that
we're facing now because we don't explicitly track the size of the
array. Now we're going to add yet more magic properties to deal this :-(
Not to mention the fact that we've no type safety on the array elements
we're storing eg  propname[0] could be an int16, propname[1] could be
a string, and so on with no checking.

|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

reply via email to

[Prev in Thread] Current Thread [Next in Thread]