On 02/22/12 14:04, Shawn Walker wrote:
On 02/21/12 17:46, Edward Pilatowicz wrote:
On Wed, Feb 15, 2012 at 09:04:03AM -0800, Shawn Walker wrote:
Greetings,
The following webrev contains general changes to improve the overall
performance of the package system:
7145683 explore general pkg performance improvements
webrev:
https://cr.opensolaris.org/action/browse/pkg/swalker/pkg-7145863/webrev/
[snip]
----------
src/tests/cli/t_pkgdep.py
- i have no idea why you removed "%(pfx)s.path=isadir/pfoo2/baz" from
double_double_stdout.
Because the test was verifying that if a user specified the same
search path twice to pkgdepend that would be seen twice in the
pkgdepend debug output. I decided it was silly for pkgdepend to
actually care that they specified it twice, and to simply ignore
redundant specifications. As a result, you'll only see one unique
entry in the output. Doing that also changed the sort order ...
[snip]
(also all changes in pkgdep)
I'd appreciate actual changes in functionality not to get rolled into a
bug dealing only with performance improvements.
Once a bug has been filed, I'm ok w/ this change in functionality,
though I'm not particularly sure why it's needed. (Perhaps that can be
included in the bug.)
As a side note, this change does actually contradict what we say in our
section 5 manpage, which is that the multiply listed attributes are
treated as unordered lists, not sets. Now, do I think it's both silly
and unlikely for someone to depend on how many times a particular
attribute name/value pair appears? Yes. But these changes do appear to
change our behavior on that issue.
imageplan.py:
1810-1811: a comment here about why we're doing something that appears
to be more work than is necessary would help. I assume it's because,
usually, oactions is empty and that check is so much faster than finding
the length of oactions ... but then I would've expected that finding the
length of an empty list to be rather fast itself...
Alternatively, you could write the code like this, which might be even
faster...
if len(actions) == 1:
if not oactions:
continue
try:
oactions[1]
# We know actions has one item and oactions has at least two
except AttributeError:
# We know actions has one item and oactions has one item, so
continue
continue
If we really hate len... then how about this?
if actions:
try:
actions[1]
except AttributeError:
<everything after "if len(actions) == 1:> in the above example
generic.py:
599-600: I assume you also compared this with using an if/elsif
construction?
Brock
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss