Re: [RFC PATCH 3/5] osinfo_loader: introduce a compiled xpaths cache

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

 



On Tue, Jun 03, 2014 at 04:08:10PM +0200, Giuseppe Scrivano wrote:
> @@ -291,7 +314,8 @@ static void osinfo_loader_entity(OsinfoLoader *loader,
>              for (j = 0; langs[j + 1] != NULL; j++) {
>                  xpath = g_strdup_printf("string(./%s[lang('%s')])",
>                                          keys[i].name, langs[j]);
> -                value_str = osinfo_loader_string(xpath, ctxt, err);
> +                comp = osinfo_loader_get_comp_xpath(loader, xpath);
> +                value_str = osinfo_loader_string(comp, ctxt, err);

I think it would be nice to push the call to osinfo_loader_get_comp_xpath
down one level into the osinfo_loader_string() function. That would mean
we only need todo the lookup in a couple of places, instead of every
single caller, while still having the perf benefit.

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 :|

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux