[Zlib-devel] Performance patch set
Stefan Fuhrmann
stefanfuhrmann at alice-dsl.de
Sun May 9 17:05:18 EDT 2010
Hi devs,
as I wrote some time ago, I have been working on
Subversion performance issues and came across
some optimization potential in zlib as well.
Inflate is now about 50% faster and a few minor
optimizations for deflate were done along the way,
too.
Although the changes are mostly independent
from each other, it would have been difficult to
create truly independent patches. Therefore, it's
all in one package. The patch was made against
1.2.5 release version.
-- Stefan^2.
[[[
Major performance enhancement in deflate_fast
plus a few minor ones in other places (see below).
All of them take advantage of various platform-
specific capabilities.
* deflate.c: make sure the UNALIGNED_OK
optimization is only used when allowed, i.e.
enforce the condition mentioned in line 1125.
* deflate.h: increase output buffer capacity such
that we can add new values in a single step
and flush on overflow afterwards (see trees.c).
Also move push_short from trees.c to here
because push_byte is there, too.
* inffast.c: major rework:
- hold / pre-fetch up to 8 bytes of data
to minimize the number of 'top up' operations
- prefetch data using a single memory access,
if allowed by CPU architecture
- copy data in large chunks w/o the need to
check for buffer ends
- unroll the literal handling loop
- general latency tuning on the critical path
* inftree.c: explicitly eliminate redundant memory
accesses as at least MS VC is not able to do it
(fearing pointer aliases?).
* trees.c: optimize send_bits based on the larger
output buffer.
* zconf.h: enable unaligned access for x86 and
x64 using GCC or MS VC. Same for little
endianess optimizations. Enable SSE2 code
when defined by compiler settings (GCC,
MS VC).
patch by Stefan Fuhrmann (stefanfuhrmann< at > alice-dsl.de)
]]]
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: zlib-1.2.5.patch
URL: <http://madler.net/pipermail/zlib-devel_madler.net/attachments/20100509/813171cf/attachment.ksh>
More information about the Zlib-devel
mailing list