git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: cleaner/better zlib sources?

From
Llinux@horizon.com <linux@horizon.com>
Date
Mar 16, 2007, 06:08 UTC
Message-ID
<20070316060841.19946.qmail@science.horizon.com>

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.

Next: Florian Weimer
Message 1 of 6 in “Re: cleaner/better zlib sources?”
  1. linux@horizon.comMar 16, 2007
  2. Florian WeimerMar 16, 2007
  3. Josef WeidendorferMar 16, 2007
  4. Linus TorvaldsMar 16, 2007
  5. linux@horizon.comMar 16, 2007
  6. Josef WeidendorferMar 16, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.