compression utilities : Java Glossary

*0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ (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 RFEs
Compactness Comparison Links

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, W2008, W7-32, W7-64, W8-32, W8-64, W2012, W10-32 and W10-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)
Reads
*.zip?
notes
WinZip 9 100% 46 59% 52,508,437 in default mode. Fastest of all, by a wide margin. It has 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. I encountered files it thought were empty. It gave no error message.
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 n/a 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. Best compression.
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

RFEs (Request For Enhancements)

There are several compression utilities, but so far, I have been unsuccessful in getting the compression utility authors to implement these two features:


This page is posted
on the web at:

http://mindprod.com/jgloss/compressionutilities.html

Optional Replicator mirror
of mindprod.com
on local hard disk J:

J:\mindprod\jgloss\compressionutilities.html
Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

IP:[65.110.21.43]
Your face IP:[54.205.179.155]
You are visitor number