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
| Andrew Morton | 2.6.23-rc3-mm1 |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Yinghai Lu | Re: [PATCH RFC] x86: check for and defend against BIOS memory corruption |
| Frederik Deweerdt | [-mm patch] remove tcp header from tcp_v4_check (take #2) |
| David Miller | [GIT]: Networking |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Herbert Xu | Re: [PATCH 2/3][NET_BATCH] net core use batching |
git: | |
