On Mon, Feb 01, 2010 at 01:17:18PM -0600, Shawn Walker wrote:
> On 01/29/10 04:44 PM, [email protected] wrote:
> >Okay.  Hopefully this is the last time this fix needs a major overhaul.
> >
> >     http://cr.opensolaris.org/~johansen/webrev-14240-4/
> 
> modules/client/transport/engine.py:
>   line 502: i don't think this check is right; did you mean:
> 
>    entry = (url, uuid)
>    if entry not in self.__orphans:
>        self.__orphans.append(entry)

Yes, you're right.  Thanks for catching this.  I wonder if it would be
better to skip the check and just use a set() instead?

>    Why not use a dict instead here?

Storing the objects in a list uses less space.  Since the requests are
now unique when identified by a url and uuid tuple, it seemed obvious to
store these as a tuple.  Can you explain what you think will be gained
by using a dict here?  It didn't seem like an obvious choice to me.

> modules/client/transport/fileobj.py:
>   line 49: why use the 128-bit int instead of the hex string?
> memory usage?

Yes, memory usage and ease of comparison.  If we assume that a 128
character string uses 8 bytes per character, that's 1k per UUID, versus
16 bytes as a integer.  Comparing 16 bytes is also going to be much
faster than a 1k strcmp.

> Otherwise, this seems fine.

Thanks for taking a look at this!

-j
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to