Thread (5 messages) flat view 5 messages, 3 authors, 2016-06-15

Re: cleaner/better zlib sources?

From: <hidden>
Date: 2016-06-15 22:43:00

Er, it's a little hard to see, but zlib spends the bulk of its time
in inflate_fast().  This is the fast path, invoked as long as there's
at least 6 bytes of input and 258 bytes of output space available.

The code in inflate.c just handles the last few bytes when near
one limit or the other.  Are you sure it's a performance problem?


There's equivalent inflate code in the PGP 5.0i distribution
(src/lib/pgp/compress/pgpZInflate.c) that's in the public domain AFAICT
(it says "Not copyrighted", and "You can do whatever you like with this
source file, though I would prefer that if you modify it and redistribute
it that you include comments to that effect with your name and the
date."), and uses switch statements only for resuming after a pause.

It's presumably well tested, but it's got a strong nasty-old-MSDOS
code smell about it, some truly bizarre indenting (don't look at lines
1118-1126 with a full stomach), and would require a lot of massaging to
integrate with zlib.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help