This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author oberstet
Recipients oberstet
Date 2013-10-17.08:06:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1381997187.57.0.66132821735.issue19278@psf.upfronthosting.co.za>
In-reply-to
Content
The zlib library provides a couple of knobs to control the behavior and resource consumption of compression:

    ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
                                         int  level,
                                         int  method,
                                         int  windowBits,
                                         int  memLevel,
                                         int  strategy));

Of these, only `level`, `method` and `windowBits` are exposed on `zlib.compressobj` (and only the first is even documented: see issue #19277).

However, as was recently found from emperical evidence in the context of WebSocket compression

http://www.ietf.org/mail-archive/web/hybi/current/msg10222.html

the `memLevel` parameter in particular is very valuable in controlling memory consumption.

For WebSocket compression (with JSON payload), the following parameter set was found to provide a useful resource-consumption/compression-ratio tradeoff:

window bits=11
memory level=4

Hence, it would be useful to expose _all_ parameters in Python, that is `memLevel` and `strategy` too.
History
Date User Action Args
2013-10-17 08:06:27oberstetsetrecipients: + oberstet
2013-10-17 08:06:27oberstetsetmessageid: <1381997187.57.0.66132821735.issue19278@psf.upfronthosting.co.za>
2013-10-17 08:06:27oberstetlinkissue19278 messages
2013-10-17 08:06:26oberstetcreate