Brock Pytlik wrote:
Shawn Walker wrote:
Greetings,

The following webrev contains fixes for the following issues:

8135 install plan creation could be faster for not yet installed packages

webrev:
http://cr.opensolaris.org/~swalker/pkg-8135/

Install plan creation could be faster for packages that no previously installed version of is present with a few tweaks to how package plans are created and the inventory function used to find and match packages.

The manifest.difference() function can eat up as much as seven or eight seconds alone when performing a "pkg install -nv redistributable" into an empty user image.

The unnecessary sorting of the entire catalog cache also slows things down a few more seconds with the thousands of repeated calls to image.inventory during plan creation.

This webrev changes manifest.difference() to detect when the origin manifest is really an EmptyCachedManifest and return early with the entire destination manifest's action set. This saves about 8% of the total time needed for a pkg install -nv redistributable into an empty user image on my system.

I am have also added an 'ordered' boolean parameter to image.inventory to allow callers to determine whether matches should be sorted by package name before being returned which saves a few more seconds for the above case.

In total, these modifications (plus one more tweak for an unnecessary expanddirs when no origin manifest is present) reduces the total time for "pkg install -nv redistributable" on my system from 1m14s to 1m4s; about a 13% or 10s reduction in total time.

There are further improvements that could be made, but this seemed like a nice improvement for relatively little change.

Cheers,

Could a difference method be added into EmptyCachedManifest (or alternatively a check made in difference in Manifest around where you're changing it now for isinstance(self, EmptyCachedManifest), so that uninstall would get a similar benefit? If you'd rather file a bug and put this off, I'm fine with that as well.

No, it's a trivial change and it appears to be a modest savings (about 8%). Thanks for noticing this!

I'll retitle the bug slightly to account for this.

The calls to inventory on line 487 of misc.py, 705 of client/api.py, and 333 of client/imageplan.py could be made to be unsorted as well I believe. If you want these to wait in the interest of stability, I'm fine with a bug.

Everything else looks fine to me.

I've already gotten client/imageplan.py 333.

As for misc.py, that should actually stay as it is, since get_inventory_list is used for package listings, and I'd imagine we want those to stay asciibetical.

Cheers,
--
Shawn Walker
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to