[Libosinfo] [RFC PATCH 0/5] various optimizations

Daniel P. Berrange berrange at redhat.com
Wed Jun 4 11:57:20 UTC 2014


On Wed, Jun 04, 2014 at 12:52:31PM +0100, Daniel P. Berrange wrote:
> On Wed, Jun 04, 2014 at 01:50:30PM +0200, Giuseppe Scrivano wrote:
> > "Daniel P. Berrange" <berrange at redhat.com> writes:
> > 
> > > I'm surprised that osinfo_entity_get_type is soo high up there too.
> > > Perhaps we do need to optimize that so we don't call it so frequently
> > > during parsing.
> > 
> > have you used this version of the series or v2?
> 
> I used the v2 series.
> 
> > In v2 I've dropped the "osinfo_loader: avoid multiple calls to
> > OSINFO_ENTITY" patch as it has not clear benefits on the wallclock but
> > it reduces the calls to osinfo_entity_get_type.
> > Callgrind says 273.345 calls vs 377.077, and it makes sense as we save 4
> > calls and it is iterated 25933 times.  Should I reintroduce it?
> 
> Let me re-test with it and report back

With that patch applied, we cut 1% off the count

Without applied:

samples  %        image name               symbol name
12036     3.4177  libosinfo-1.0.so.0.2.10  osinfo_entity_get_type

With it applied

samples  %        image name               symbol name
8757      2.6948  libosinfo-1.0.so.0.2.10  osinfo_entity_get_type


So I guess that is probably worth it.

NB, i modified your demo.c program so that it iterates over that
code 50 times, so we get an acceptably long run time, otherwise
the performance count sampling is too non-deterministic

Regards,
Daniel
-- 
|: 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 :|




More information about the Libosinfo mailing list