[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: The Performance Elephant is Dead

From: Stefan Fuhrmann <stefanfuhrmann_at_alice-dsl.de>
Date: Wed, 07 Jul 2010 22:45:59 +0200

Peter Samuelson wrote:
> [Stefan Fuhrmann]
>
>> * zlib: major deflate() and adler32() speedup, minor inflate() speedup
>>
>
> What is the story with the s->level > 0 thing in deflate.c? I note
> that you slide the hash table only if s->level > 0, but the comment
> right above this states:
>
> /* Slide the hash table (could be avoided with 32 bit values
> at the expense of memory usage). We slide even when level == 0
> to keep the hash table consistent if we switch back to level > 0
> later. (Using level 0 permanently is not an optimal usage of
> zlib, so we don't care about this pathological case.)
> */
>
> >From this comment, it looks like adding your "if (s->level > 0)" adds a
> bug. The only time it would work properly is if you use what they call
> "this pathological case", which Subversion does not.
>
That's why this is prototype code ;). The optimization you cite is
no longer needed because svnserve will bypass zlib entirely for
compression level 0.

Also, this is not the latest code. In my working copy, the zlib patch
uses SSE2 instructions (if supported by the CPU) for the saturated
unsigned subtraction for that loop. So, all compression levels
experience some speedup.

-- Stefan^2.
Received on 2010-07-07 22:47:03 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.