compression utilities : Java Glossary

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/W2003/Vista/W7-32/W7-64 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 (Graphic User Interface) 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 (Hypertext Markup Language), 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 (Lempel—Ziv—Markov chain Algorithm) 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 (Roshal Archive) 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,Java version 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 (Random Access Memory), 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
7-Zip
archive
ARJ: one of the original command-line archivers
bzip2
Comparison of features of compression utilities
compression
GZIP
Huffman encoding
Info-Zip: free portable Zip/Unzip
jar.exe
jZip: free, handles Zip, TAR, GZip and 7-Zip
Pack200.exe
PKZIP
send big files
WinRar
WinZip
Zip

CMP homejump to top You can get the freshest copy of this page from: or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror)
http://mindprod.com/jgloss/compressionutilities.html J:\mindprod\jgloss\compressionutilities.html
logo
Please email your , letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : feedback email. If you want your message, your name or email kept confidential, not considered for public posting, please explicitly specify that. Unless you state otherwise, I will treat your message as a letter to the editor that I may or may not publish in the feedback section. After that, it will be too late to retract it. If you disagree with something I said, please quote it and cite the web page where you found it, tell me why you think it is wrong, and, if possible, provide some supporting evidence. Threatening to kill me or spouting obscenities has yet to persuade me to change my mind.
mindprod.com IP:[65.110.21.43]
view BlogYour face IP:[38.107.179.211]
You are visitor number 13,879.