[RFC] KnitData.read_records_iter() returns records out of order
Michael Ellerman
michael at ellerman.id.au
Tue Jun 27 02:46:00 BST 2006
On 6/26/06, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Michael Ellerman wrote:
> > On 6/26/06, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
> >> Michael Ellerman wrote:
>
> >> My preference, in terms of cleanliness, would be to have the Transport
> >> take care of requesting the records in optimal order and returning them
> >> in the requested order.
> >
> > 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.
>
> It would be possible to structure readv so that it always returned the
> records in the requested order, but didn't store them in a map unless
> the requested order differed from the optimal order.
Yeah I'm sure it would. My point is that we should do all sorting
lazily, ie. only when we really need to. So we don't sort things
before we give them to the transport, because the transport might not
need or want them sorted. And once the transport's read things in its
most optimal order, we don't sort the result until we actually require
the result to be sorted in some way.
cheers
More information about the bazaar
mailing list