[Zlib-devel] Performance patch set
Stefan Fuhrmann
stefanfuhrmann at alice-dsl.de
Mon May 10 05:03:32 EDT 2010
Mark Adler wrote:
> Stefan,
>
> Please package your patch as a file, since these things don't translate well in the body of an email.
>
Sorry about that! I added it as an attachment
just like last time and at least the copy I got
from the mailing list contained the data both,
inline and as attachment.
Anyway, here is the non-diffed package of
changed files as requested by Gilles.
> On May 9, 2010, at 2:05 PM, Stefan Fuhrmann wrote:
>
>> Inflate is now about 50% faster
>>
>
> Thank you for your work! That is a major improvement. I will give it a try and see how it does with gcc instead of msvc.
>
> Changes of this magnitude leads me to think I should add you as a co-author of inffast.c if they are adopted. I assume that you would agree to the zlib license in that case?
>
Please do ;) No problem with the license.
>
>> * inftree.c: explicitly eliminate redundant memory
>> accesses as at least MS VC is not able to do it
>> (fearing pointer aliases?).
>>
>
> I don't understand this. What is it that msvc is not able to do?
>
VC won't optimize common sub-expressions
if they refer to memory if there are write accesses
in between. Reason behind it: the compiler is not
sure that all pointers refer to disjoint memory regions.
An example (work[sym] never gets optimized):
if ((int)(work[sym]) < end) {
here.op = (unsigned char)0;
here.val = work[sym];
}
In some cases, it seems to be even more conservative.
All my changes in inftree.c actually result in shorter
assembly code.
-- Stefan^2.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zlib-1.2.5.changes.tar.gz
Type: application/gzip
Size: 47150 bytes
Desc: not available
URL: <http://madler.net/pipermail/zlib-devel_madler.net/attachments/20100510/7971cea8/attachment.gz>
More information about the Zlib-devel
mailing list