
Some information which you may find interesting reading.  De Darryl G7LED.


LZW Compression
===============

Memory usage:

   The formula to calculate the amount of memory used by the
   compress/decompression tables is (2^num_bits * 3), e.g.:

      9 bits: 1536 bytes.
     10 bits: 3072 bytes.
     12 bits: 12288 bytes.
     14 bits: 49152 bytes.
     16 bits: 196608 bytes.

   So its no wonder most NOS's offer 16 bits compression, but then fall back
   to use 9 bits!!.  If you run a MS-D*S NOS then if you have enough core
   left setup your "lzw bits 12" rather than 16, some quick tests say that
   if you go too high and don't have the memory it will fall back to 9, and
   the compression ratio will be low.

   Don't forget that the above table only refers to the data travelling in
   one direction, so multiply it by two for the amount of memory needed for
   the compression table on transmit and decompression table on receive.


Statistics:

   Here are some conversd compression statistics.

     9 bits: 1.2:1
    12 bits:   2:1
    16 bits: 2.2:1

   All results were taken at around the 100Kb of decompressed data mark.

   Any more information to increase the table would be appreciated, but as
   you can see 9 bits seems hardly worth the effort, and this is what many
   MS-D*S based NOS's fall-back to if they don't have 400Kb or so of core
   left.

   The optimum looks about 13 or 14 bits, as the compression ratio does not
   increase significantly to warrant the increased memory usage, with no
   compression ratio benefit.

   As the table is built it, it is probably impractical for me to make a
   judgement on 14 bits or more, as 100Kb is probably not enough data to
   fill up the dictionary.

   Anyone produced a set of compression statistics for compressed
   SMTP/NNTP?

--
De Darryl G7LED
