On Thu, 14 Aug 2008, Linus Torvalds wrote:Interestingly, it turns out that git also hits a sad performance downside of using zlib. We always tend to set "stream.avail_out" to the exact size of the expected output. And it turns out that that means that the fast-path case of inffast.c doesn't trigger as often as it could. This (idiotic) patch actually seems to help performance on git rev-list by about 5%. But maybe it's just me seeing things. But I did this because of the entry assumptions in inflate_fast(), that code only triggers for the case of strm->avail_out >= 258. Sad, if true. Linus --- sha1_file.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index a57155d..5ca7ce2 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -1500,11 +1500,11 @@ static void *unpack_compressed_entry(struct packed_git *p, z_stream stream; unsigned char *buffer, *in; - buffer = xmalloc(size + 1); + buffer = xmalloc(size + 256 + 1); buffer[size] = 0; memset(&stream, 0, sizeof(stream)); stream.next_out = buffer; - stream.avail_out = size; + stream.avail_out = size + 256; inflateInit(&stream); do { -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Zhang, Yanmin | AIM7 40% regression with 2.6.26-rc1 |
| Con Kolivas | [PATCH][RSDL-mm 0/7] RSDL cpu scheduler for 2.6.21-rc3-mm2 |
| Nick Piggin | [patch 4/6] mm: merge populate and nopage into fault (fixes nonlinear) |
| Andrew Morton | -mm merge plans for 2.6.23 |
git: | |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Natalie Protasevich | [BUG] New Kernel Bugs |
