[MERGE] 22% Faster logs by optimizing get_texts

Michael Ellerman michael at ellerman.id.au
Sat Jun 17 07:55:52 BST 2006


On 6/17/06, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi all,
>
> This patch continues my log performance work, by implementing get_texts
> so that it is a single readv operation.
>
> Note that it was also necessary to sort the records before sending them
> to readv-- should readv do its own sorting?

I've bumped into that while working on the HTTP multipart stuff. It
turns out we'd have much better performance in current bzr if we just
sorted the readv offsets before trying to combine ranges.

The problem with doing the sorting in readv() is that some users of
the API might be able to present the offsets in sorted order cheaply,
which makes it a pity for readv to then sort it again.

We could just have a helper function that readv users can call. Or a
flag to say it's already sorted? I guess this is micro-optimisation
compared to network-io, but it just seems like a pity.

cheers




More information about the bazaar mailing list