From: Willy Tarreau Date: Fri, 26 Oct 2012 09:36:40 +0000 (+0200) Subject: MINOR: compression: optimize memLevel to improve byte rate X-Git-Tag: v1.5-dev13~114 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7e488d781ccfb5615d860dc348035cc25b184a79;p=thirdparty%2Fhaproxy.git MINOR: compression: optimize memLevel to improve byte rate Decreasing the deflateInit2's memLevel parameter from 9 to 8 does not affect the compression ratio and increases the compression speed by 12%. Lower values do not increase transfer speed but decrease the compression ratio so it looks like 8 is optimal. --- diff --git a/src/compression.c b/src/compression.c index 87449acf12..45244a075d 100644 --- a/src/compression.c +++ b/src/compression.c @@ -317,7 +317,7 @@ int gzip_init(void *v, int level) strm->zfree = Z_NULL; strm->opaque = Z_NULL; - if (deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS + 16, 9, Z_DEFAULT_STRATEGY) != Z_OK) + if (deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS + 16, 8, Z_DEFAULT_STRATEGY) != Z_OK) return -1; return 0;