views:

141

answers:

3

Hi SO,

I'm wondering if anyone has a clue on whether the gzip compression is as much useful on mobile devices than it is on a desktop computer.

Will the phone use more battery? Or will it save some because of the bandwidth saving? Will the page page load faster or is the uncompress process slow on those limited devices?

Does the compressed data actually reach the end-user or is it uncompressed somewhere by the 3G provider? (this may be a stupid question, sorry).

Thank you.

+3  A: 

Not a stupid question at all.

The correct trade-of is in favor of GZip.

It turns out that the Lempel-Ziv decompression is fairly cheap (much unlike the compression), while bandwidth is usually quite expensive, esspecially for roaming consumers, and also takes much battery power and transfer time.

Pavel Radzivilovsky
Additionally, in congested areas, bandwidth can be very limited, in addition to costly if roaming.
Nate Bross
So you believe the decompression process uses less battery than the additional transfer cost?What about the compressed data reaching the end-user?
Savageman
yes, and I didn't quite understand the second part.
Pavel Radzivilovsky
@Savageman - definitely. The power used by the CPU decompressing the data would be tiny in comparison to the power used by transferring extra data over a radio interface.As for roaming, the monetary cost can be in the dollars-per-megabyte range.
chrisbtoo
And yes, the data would reach the user compressed - it would be insane for a mobile operator to deliberately decompress the data and make it bigger, as it would congest their networks more than necessary.
chrisbtoo
A: 

It always depends on where your bottleneck is.

  • If it is a very weak cpu, anything that puts a bigger burden on it is bad.
  • If is your network connection, compressed data transfer is a huge performance boost.
  • The strain on the battery should be negilible in any case

With today's mobile devices, cpu power is certainly weaker that that of a desktop pc, but usually strong enough for gzip compression and decompression. In most cases, the bottleneck will be the network connection, so gzip compression is certainly useful. There will be rare cases though, where the opposite is true.

You just need to use a little common sense to see if my answer applies to your special case ;-)

Treb
Thanks, that looks interesting!What about the compressed data reaching the end-user?
Savageman
Interesting point! If you send a gzip compressed file, it will definitely be transferred to the recipient as such. If you use gzip compression for http transfers, the 'relay' stations on the way should not care about the message content at all and leave it unchanged as well. (And why should they waste their own cpu time to increase the bandwidth usage of forwarded packages?)
Treb
Yes, I guess the opposite would be more likely.
Savageman
A: 

One question you may also want to investigate is whether or not the mobile browsers you are considering even support compression. For example, I just checked the request headers sent by my BlackBerry Storm and it does not send any "Accept-Encoding" headers -- which means the server should not send back a compressed response.

Marc Novakowski
You're right, very good point. But Apache takes care of this for me automagically. :-)
Savageman