Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Is there a compression level which will provide an optimal balance between file size reduction and client decompression time/cost?

I was wondering which GZIP compression level provided the best balance between file size reduction and decompression time. Compression time doesn't really matter since it will only be compressed once and cached. However, I'm concerned that if I set the compression level too high, any gains from file size reduction will be wiped out by the time and cost required to decompress the file on the client side.

share|improve this question
add comment

1 Answer 1

up vote 7 down vote accepted

It is unlikely that the compression level affects the decompression time. The tradeoff is in how much time/memory is spent in compression searching for the smallest way to express the input data — more compression isn't just extra layers of processing on both ends (that would be a good way to make the data larger).

Once the data is compressed, decompressing it is just following the instructions in the compressed file; there's no guesswork, and a better-compressed file might well be faster to decompress since less input data needs to be read.

share|improve this answer
    
You're right - for some reason I had the idea in my mind that it would take longer to decompress. It's actually faster to decompress a file compressed with a higher setting (with gzip): tukaani.org/lzma/benchmarks.html - Thanks for clearing it up! –  CD Sanchez Aug 4 '11 at 1:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.