compression utilities : Java Glossary
home C words local find no local find frame, full screen Google search web for topic jump to footer translate with Babelfish 2006-02-26 by Roedy Green ©1996-2008 Canadian Mind Products
Go to : punctuation 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z (all)
compression utilities
Stand alone compression utilities let you bundle groups of files together, and compress them for backup or distribution. Java also has built-in compression classes.
Java Compression Classes Speed Comparison
The Lineup Links
Compactness Comparison

Line up of Standalone Compression Utilities

There are various archiving compression utilities such jar.exe, Pack200.exe, PKZIP, WinRar, WinZip, 7-zip and bzip2.

I did not benchmark BZip2. I did not have the patience to decode its installation instructions.

NT/W2K/XP/W2K3/Vista has a built-in compact utility for storing files in compressed form in a transparent way. You just use the files normally. You don’t have to use a utility to decompress them first. You use it like this:

// compress a directory tree
compact.exe /C /S:mydirtree
You can also compress and decompress directories with the GUI explorer properties.

Compactness Comparison

I used a test set of files, the ones I post to the mindprod.com website, less the zip files. My test suite contained HTML, images, sound files, jars, and serialised java objects already GZIPped. I then compressed them in various ways, choosing the maximum allowed compression. The best, most compact is near the top. 7-zip is by far the best at compressing. It is free, and easy to use, so you might as well use it. The max-compression options take considerably longer than the standard compressions. You would not used them routinely, e.g. just to prepare backups. I think though it is time to start recognising 7-zip as the leader in compression, and start at least offering that format as an alternative for downloads. Not only is 7-zip the best compressor has the simplest GUI to use of all the compression utilities,
Comparison of Compactness of Various Compression utilities
Utility % of original size
(smaller is better)
size in bytes
(smaller is better)
notes
7-zip 42% 37,357,861 in PPmD Ultra mode. Best compression. However, other compression algorithms are almost as good and are quite a bit faster.
7-zip 42% 37,826,519 in LZMA Ultra mode
7-zip 44% 39,134,141 in Bzip2 Ultra mode
Winzip Double Zipped 46% 40,774,398 double zipped. archive with compression turned off, then zip that zip with maximum enhanced deflate. The end result is a zip inside a zip, possibly a bit confusing for the recipient.
WinRar 55% 49,176,236 in RAR best mode
Winzip 58% 52,370,193 in non-compatible, maximum enhanced deflate
PKZIP 59% 52,635,830 in maximum compression mode. This is barely better than the standard compression. This is the PkWare the originators of the PKZIP format.
Jar.exe 68% 52,653,468 no manifest, JDK 1.6
Windows Compact 91% 81,433,854 Windows built-in compact
Original 100% 89,558,283 Size before compression
These comparison results are not as important as you may think for two reasons:
  1. You can’t post files compressed with proprietary algorithms on the web or people will have trouble unpacking them. You need to make provision that the receivers of the files have the corresponding decompress program.
  2. Various super-compression techniques take considerably more time than the standard zip. In most cases the saving in space won’t be worth the extra time to prepare the zips.

Speed Comparison

I ran each of these utilities in its default compression strength. The fastest is at the top. Winzip was considerably faster than the competition. This is what I use for preparing zips for my website. All these tests were done on Win2K with 512 MB RAM, and at Athlon XP 2000+ 1.7 GHz processor.
Comparison of Speed of Various Compression utilities
Utility % of best speed
(bigger is better)
time in seconds
(smaller is better)
% of original size
(smaller is better)
size in bytes
(smaller is better)
notes
Winzip 9 100% 46 59% 52,508,437 in default mode. Fastest of all, by a wide margin. It as the most difficult user interface. It is also the one I am most familiar with. Very easy to get the wrong files or wrong level of qualification. No tree view of the zip file structure.
PKZIP 82% 56 59% 52,665,195 in standard compression mode. This is the PkWare the originators of the PKZIP format.
Jar.exe 68% 1:08 59% 52,653,468 Sun Java jar creator 1.6
WinRar 41% 1:53 57% 51,221,269 in RAR mode. Easiest to understand user interface.
Windows Compact 43% 1:47 91% 81,433,854 Windows built-in compact
Original 38% 2:02 100% 89,558,283 Time for a simple copy. Size before compression. Astoundingly, Microsoft is so incompetent it takes them longer to do a simple file copy than it takes for others to compress the files.
7-zip 33% 2:21 43% 38,420,302 in standard LZMA mode
7-zip 29% 2:37 44% 39,253,316 in standard Bzip2 mode
7-zip 29% 2:39 43% 38,805,582 in standard PPmD mode

CMP_homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.17] The information on this page is for non-military use only.
You are visitor number 6,764. Military use includes use by defence contractors.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/Mindprod website mirror)
http://mindprod.com/jgloss/compressionutilities.html J:\mindprod\jgloss\compressionutilities.html