comp.lang.ada
 help / color / mirror / Atom feed
From: gautier_niouzes@hotmail.com
Subject: Re: Poll for the users of ZLib-Ada
Date: Wed, 16 Mar 2016 01:36:33 -0700 (PDT)
Date: 2016-03-16T01:36:33-07:00	[thread overview]
Message-ID: <ac986ae0-3c3b-40be-9858-56a121b2ecba@googlegroups.com> (raw)
In-Reply-To: <nca0ch$5fe$1@loke.gir.dk>

On Tuesday, March 15, 2016 at 10:55:30 PM UTC+1, Randy Brukardt wrote:

> Wasn't the purposes of those lower levels to use less CPU time and space? 
> But that hardly matters anymore, because the difference between 0.010 sec 
> and 0.022 sec isn't noticable (CPUs are 1000x), and we have oceans of memory 
> compared to the 1980s when ZIP was invented.

Well, 0.022 sec is more than the double than 0.010 sec! You'll notice a kind of difference when you process large data...
Concerning memory, agreed, it is no more a concern. BTW, the zip/zlib code uses the same buffers for all compression levels.
The compression level is used to select various thresholds for the pattern matching algorithm.

> They probably need to exist because of compatibility with old ZIP files but
> even in the 1980s I don't think they were used much (I don't recall ever 
> using them on purpose, although I think PKZip would sometimes decide to use 
> them itself for whatever reason).

Old (or new) Zip files need to be *decompressed*.
You don't need a compression software to read them, and even less to choose a compression level, in the zlib sense.
What some versions of PKZip did was to choose between two formats: Shrink (LZW) and Reduce (LZ + probabilistic reduction).
For a Zip file built by that version of PKZip, you would need a decompression software that is supporting both
Shrink and Reduce formats, like Zip-Ada.

Actually there may be various strategies depending on the input data, and on various scopes.
Within the Deflate format there are 3 sub-formats for compressing chunks of data.
For instance the compression algorithm can choose to store the chunk (or the entire file)
if data is too random for being efficiently compressed.
On a larger scope, you can have a pick-and-choose strategy, as in the ReZip tool, and select
the most efficient compression (format and algorithm) for each file. Currently ReZip tries
20 variants, some with randomized parameters:

   Shrink
   Reduce_4
   Deflate_f
   Deflate_1
   Deflate_2
   Deflate_3
   External: Zip, -9
   External: 7-Zip, a -tzip -mm=deflate -mfb=258 -mpass=#RAND#(7,15) -mmc=10000
   External: 7-Zip, a -tzip -mm=deflate64 -mfb=257 -mpass=15 -mmc=10000
   External: KZIP, /rn /b0
   External: KZIP, /rn /b#RAND#(0,128)
   External: KZIP, /rn /b#RAND#(128,2048)
   External: Zip, -#RAND#(1,9) -Z bzip2
   External: 7-Zip, a -tzip -mm=LZMA -mx=9
   External: 7-Zip, a -tzip -mm=LZMA a=2 d=19 mf=bt3 fb=128 lc=0 lp=2
   External: 7-Zip, a -tzip -mm=LZMA a=2 d=#RAND#(3200,3700)k mf=bt4 fb=#RAND#(255,273) lc=2 lp0 pb0
   External: 7-Zip, a -tzip -mm=LZMA a=2 d=25 mf=bt3 fb=255 lc=7
   External: 7-Zip, a -tzip -mm=LZMA a=2 d=26 mf=bt3 fb=222 lc=8 lp0 pb1
   External: AdvZip, -a -4

_________________________
Gautier's Ada programming
http://gautiersblog.blogspot.com/search/label/Ada
NB: follow the above link for a valid e-mail address 


  reply	other threads:[~2016-03-16  8:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-08 21:35 Poll for the users of ZLib-Ada gautier_niouzes
2016-03-12 20:37 ` Björn Lundin
2016-03-15  8:28   ` gautier_niouzes
2016-03-15 21:55     ` Randy Brukardt
2016-03-16  8:36       ` gautier_niouzes [this message]
2016-03-17  0:15         ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox