What is the difference in gzip compression levels?

4

Have been using gzip for a few years and usually I always gzip -9 out of habit as it is the highest level of compression. I understand that lower levels means less compression but quicker compress rate.

What is the real difference between the levels of compression?

From what I have read regarding DEFLATE (what gzip uses), the levels specify the amount of time the algorithm spends finding repetition in bytes and encoding the data properly. I don't quite understand how this would differ between one pass of a file or multiple passes of a file. Wouldn't all bytes that are replicated be compressed on the first pass (all the repetition removed)?

Azifor

Posted 2016-10-12T14:28:16.073

Reputation: 141

What makes you think it's doing "multiple passes"? – Ƭᴇcʜιᴇ007 – 2016-10-12T14:37:39.853

@Ƭᴇcʜιᴇ007 That is a valid point, limited knowledge of compression so perhaps I misread something somewhere to give me that idea. Is it not doing multiple passes? – Azifor – 2016-10-12T14:42:56.347

No answers