From 7e488d781ccfb5615d860dc348035cc25b184a79 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 26 Oct 2012 11:36:40 +0200 Subject: [PATCH] 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. --- src/compression.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.3