[Libguestfs] [PATCH] tests/c-api: cache available features

Richard W.M. Jones rjones at redhat.com
Wed Nov 4 20:55:13 UTC 2015


On Wed, Nov 04, 2015 at 06:42:13PM +0100, Pino Toscano wrote:
> Build a list of all the features used in action tests, and lazily read
> them as needed.  This reduces the number of guestfs_feature_available
> calls for a full run from 117 to 18.

ACK.

But even better if you turned guestfs_feature_available into a
non_daemon_function, added a new guestfs_internal_feature_available
daemon_function, and then cached the results on the library side.
They can never change for the duration of a libguestfs library load,
as far as I know.

That would benefit all libguestfs users.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html




More information about the Libguestfs mailing list