Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Rebalance compression levels. #31
This will rebalance the compression levels to have a more even distribution of compression levels. The general trend of this is to make compression faster, which means that a given compression level (except 1 and 9) will be faster.
The existing implementation favors compression, and from level 5 and up, very small compresssion improvements are added for very high computation cost.
Rough guidelines: Previous level 3 speed is now equal to level 6.
New default is level 5, which in most cases offers a quite good compression, without getting diminished returns from additional computation power.
See "rebalance" tabs for benchmarks of rebalanced levels:
One thing I note about the original values: they seem to correspond to the compression levels in zlib. Even the
I like the idea of having more speed/size tradeoffs available, but I'd also like a note in the docs saying that the compression levels work differently than zlib.
@willglynn You are right. It makes good sense to document why these values are different than zlib.
That said, in my tests zlib has always performed ~1 level worse than go deflate in terms of compression. Noting that you shouldn't expect settings to carry over 1:1 makes sense.