[email protected] wrote:
On Fri, Oct 23, 2009 at 03:40:32PM -0500, Shawn Walker wrote:
So much for third time being the charm (but this changeset is 128 lines).

new webrev (as a difference against pkg-cat-p3-3):
http://cr.opensolaris.org/~swalker/pkg-cat-p3-4/

In general, this looks good.  I appreciate you adding
get_entry_signatures(), but I found a nit with the implementation.

In particular, if you change the inner part of the iteritems() loop to
the following, the code runs more than 5x faster on a list with only a
few items matching "signature-":

        if k.startswith("signature-"):
                sig = k.split("signature-")[1]
                yield sig, v

Apparently, it's expensive to raise/catch all of those exceptions.

What about this instead?

return (
    (k.split("signature-")[1], v)
    for k, v in entry.iteritems()
    if k.startswith("signature-")
)

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

Reply via email to