W3C home > Mailing lists > Public > public-bpwg@w3.org > July 2008

Re: Gzip useful or not

From: Dominique Hazael-Massieux <dom@w3.org>
Date: Tue, 01 Jul 2008 14:04:00 +0200
To: Stephane Boyera <boyera@w3.org>
Cc: public-bpwg <public-bpwg@w3.org>
Message-Id: <1214913840.7290.22.camel@altocumulustier>

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:08:57 UTC