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

Giuseppe Scrivano gscrivan at redhat.com
Wed Jun 4 10:44:07 UTC 2014


"Daniel P. Berrange" <berrange at redhat.com> writes:

>> This series was applied to the libosinfo source.
>> 
>> function                   total time spent in the function
>> 
>> osinfo_loader_get_device  32.83%
>> osinfo_db_get_device      2.96%
>> osinfo_db_add_device      4.50%
>> osinfo_db_new             24.97%
>> 
>> so creating a new GObject is very slow.  I thought about creating just a
>> model object and then clone it instead of going trough the gobject
>> constructors for every instance.  Does it sound like a good idea?  (I am
>> not still sure if g_type_create_instance will be enough to achieve this,
>> haven't looked into details).
>
> What's the actual wallclock time this demo takes to run for you ?
>
> For me it is a fraction of a second, which seems pretty fast and shouldn't
> be noticable by the user.
>
> $ time ./demo 
>
> real	0m0.238s
> user	0m0.218s
> sys	0m0.014s

It takes approximately the same time for me as well.  Indeed, it is not
much time but it seems noticeable in the upstream version of
virt-manager, where the UI seems a bit slower compared to older versions
without libosinfo when the data is accessed for the first time and I
preferred to optimize this in libosinfo instead of a workaround in
virt-manager.
Anyway, this series cuts enough wallclock time that this effect is much
less noticeable now that shouldn't be a problem for virt-manager users
too.

Regards,
Giuseppe




More information about the Libosinfo mailing list