michaelpj / pure-zlib

A Haskell-only implementation of zlib / DEFLATE.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A Pure ZLib

This library is intended as a pure replacement for zlib, for systems in which you either desire the benefits of a high-level implementation or for systems in which zlib is not supported. Presently, the cost for these is decreased performance; our buffering and output systems are not nearly as tuned as zlibs has been, resulting in roughly 100x worse performance.

Getting to Know the Code

Most users will want to use the functions in Codec.Compression.Zlib, which provides both all-in-one as well as an incremental decompression functions. The latter can be used in a stream of incremental parsers, or in situations in which memory is limited.

Those that would like to hack on the implementation might look at the following files:

Compression

Compression is not yet implemented by the library, but is one of our early TODOs.

GZip Support

The core DEFLATE implementation used in this library should be the same one used in GZIP files. However, we currently only work with classic *.Z files, which have a different header, output, and checksum. Expanding this library would likely make it vastly more useful.

This is another early TODO.

Performance

Performance is notably worse that zlib, but probably still acceptable for many uses. If you want to help improve the performance of pure-zlib, we are certainly very, very excited for you to help. We've done a bit of work on it, but the more the merrier.

What we have discovered is that most of the slowdown is in the OutputWindow mechanism. We spend a lot of time in there keeping track of data and shifting data out of the system. So ... this might be an obvious place to look.

We've done some considerable work on the input side, such that we don't think that's necessarily a good place to mine. However, if you want to, and you can show improvements, go for it.

About

A Haskell-only implementation of zlib / DEFLATE.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Haskell 100.0%