On 08/03/11 16:33, Brock Pytlik wrote:
Webrev:
https://cr.opensolaris.org/action/browse/pkg/bpytlik/18702-v1
Bug:
18702 pkgdepend resolve can be faster
The speed improvement depends heavily on both the kind of resolve being
done, and the machine it's running on.
In general, the improvement is greater if a small number of packages are
being resolved, and a large number of packages from the system are being
resolved against. Also, if the machine's bottleneck is related to IO
bandwidth instead of CPU processing, then the improvement will be larger.
When resolving the dependencies in ON, I saw improvements ranging from
5% (a machine with lots of IOPS) to 24% (my desktop).
On my desktop, resolving the pkg gate improved by about 30%.
src/modules/publish/dependencies.py:
line 1344: no longer needed
lines 1346-1348: No longer true; you don't re-use pkg_list anymore,
so just use the generator directly instead of creating a pkg_list
object. That should have the bonus of making this slightly faster
and reducing memory usage.
line 1356: this should be moved after line 1358; you can use 'stem'
to check if its in resolving_pkgs instead and avoid constructing
the FMRI object you won't use.
line 1361: use 'stem' here instead of pfmri.pkg_name; it's faster
since Python won't have to generate opcodes for property access
and it's just as readable.
lines 1351-1354: If there could be lots of entries in the tmp_*
dictionaries here, you could significantly reduce memory usage
by calling 'del' on them after you're done with them. Otherwise,
Python will keep them around until function exit.
lines 1355-1380: Some comments above each block of logic here would
help future maintenance.
-Shawn
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss