[RFC] KnitData.read_records_iter() returns records out of order

Michael Ellerman michael at ellerman.id.au
Mon Jun 26 09:04:36 BST 2006


On Mon, 2006-06-26 at 16:34 +1000, Robert Collins wrote:
> On Mon, 2006-06-26 at 16:27 +1000, Michael Ellerman wrote:
> 
> > I disagree, although that might be clean, it means we end up doing
> > work we don't need to. I'd rather push the sorting requirement up the
> > stack, so that we delay sorting as long as possible, and some callers
> > won't require sorting at all.
> > 
> > So we document the fact that readv() may return records out of order,
> > and so on up the stack. We can write an OutOfOrderLocalTransport that
> > returns everything in random orders for testing.
> 
> Performance wise, its quite important to be doing ordered reads through
> the underlying file. This is at odds with pushing the sort order up the
> stack.

Well maybe. Only the Transport knows what the most efficient order is,
so we shouldn't be prematurely sorting on the way down to the transport,
it should be up to the transport. 

And having read the records in the most efficient order, we shouldn't
prematurely sort them on the way up - when we get to somewhere in the
API where the records _need_ to be sorted, then we can do it.

cheers

-- 
Michael Ellerman
IBM OzLabs

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060626/d8f10099/attachment.pgp 


More information about the bazaar mailing list