Re: Gzip useful or not

Le mardi 01 juillet 2008 à 13:51 +0200, Stephane Boyera a écrit :
> > I think there are 2 key questions to consider when deciding whether
> > something should be sent gzipped or not (if the browser supports it,
> > obviously):
> 
> i was wondering if the memory size is a potential problem or not ?
> AFAIK, with a gzipped content, you need twice the memory while unzipping.

According to the zlib web site:
        The memory requirements for decompression depend only on
        windowBits [...]:

        inflate memory usage (bytes) = (1 << windowBits) +
        1440*2*sizeof(int)

        Typically, therefore, inflate() requires no more than 44 KB of
        storage on a 32-bit machine--this includes the 32768-byte
        sliding window and 11520 bytes of inflate_huft allocations.
http://www.gzip.org/zlib/zlib_tech.html

If I understand correctly, that means gzip will require at most 44KB to
decompress a file (however big it is) on a 32 bits architecture. I'm not
sure if the 1440*2*sizeof(int) is a uniform tax on any decompression, or
only the worse case scenario...

Dom

Received on Tuesday, 1 July 2008 12:05:25 UTC