[PATCH] hgweb: return data in increasing chunk sizes

Dirkjan Ochtman dirkjan at ochtman.nl
Sat Nov 22 03:03:05 CST 2008


This looks good. Some nits:

On Sat, Nov 22, 2008 at 00:58, Brendan Cully <brendan at kublai.com> wrote:
> # HG changeset patch
> # User Brendan Cully <brendan at kublai.com>
> # Date 1227311500 28800
> # Node ID 368594f505148b5dbe60b3dd74080474334d23dc
> # Parent  03b60f2f90bf14594ffd733cace1102c5c10499b
> hgweb: return data in increasing chunk sizes
>
> Currently hgweb is not streaming its output -- it accumulates the
> entire response before sending it. This patch restores streaming
> behaviour, buffering the output sensibly (currently, it produces 1K,
> then 2K, then 4K up to a maximum buffer size of 64K). Local testing of
> a fetch of a 100,000 line file with wget produces a slight slowdown
> overall (up from 6.5 seconds to 7.2 seconds), but instead of waiting 6
> seconds for headers to arrive, output begins immediately.

Maybe change this a bit to note that it's not just hgweb anymore.

> @@ -55,6 +56,8 @@
>         self.base = (mapfile and os.path.dirname(mapfile)) or ''
>         self.filters = filters
>         self.defaults = defaults
> +        self.minchunk = minchunk
> +        self.maxchunk = maxchunk

Maybe a tuple is nicer here than two separate attribs.

Let's put this is in 1.1, too.

Cheers,

Dirkjan


More information about the Mercurial-devel mailing list