Tuesday, June 28, 2011

Compression Software

Everyone's heard of Zip (or more accurately PKZip). It's become the ubiquitous compression standard. But it's far from the only one, and as it turns out not necessarily the best one either. Recently I was curious how PKZip compares to some of the other newer compression algorithms out there. So I tested it against RAR and 7Zip.

Before I get into the results I wanted to talk about how I tested. I created 5 data sets, and then used each of the three programs to compress the data. I looked at the resulting file size to determine which compressed more. I also timed the compression since speed is another important factor.

Binary Files

For my first test I took 289MB of binary files, i.e. EXEs and DLLs. These files typically compress well.

PKZip: 124MB and 39 seconds.

RAR: 105MB and 55 seconds.

7Zip: 85MB and 92 seconds.

Text Files

For this test I used 26MB of text files. Again, these typically compress very well.

PKZip: 6MB and 2 seconds.

RAR: 5MB and 4 seconds.

7Zip: 3MB and 10 seconds.

MP3 Files

I took a large folder of MP3 files. MP3 files are already compressed and typically do not compress well.

PKZip: 284MB and 33 seconds.

RAR: 283MB and 91 seconds.

7Zip: 283MB and 84 seconds.

JPG Files

As with MP3 files, I took a directory of JPG files. Also as with MP3 files, JPGs are compressed and typically don't compress well.

PKZip: 10MB and 1 second.

RAR: 10MB and 2 seconds.

7Zip: 10MB and 2 seconds.

Miscellaneous Files

For the last test I took a large directory tree of miscellaneous files (54MB in size). This should provide a good overall sample.

PKZip: 14MB and 5 seconds.

RAR: 14MB and 6 seconds.

7Zip: 8MB and 12 seconds.

Conclusions

In every test PKZip was the fastest. Also, in every test except the JPG test 7Zip had the highest compression. And in almost every test RAR was right in the middle for both speed and compression amounts. So which is the best compression tool to use? That's hard to say. PKZip is nice and quick, and it's become extremely common. 7Zip has very impressive compression levels, and it's totally free. RAR is hard to pin down. On the one hand you could say it did not shine and any one category. But on the other hand you could say it was a middle ground, the best of the two of them.

For me personally, I'm probably going to trade off between PKZip and 7Zip. I may start to use 7Zip more now that I've seen how impressive it's compression levels really are. But it will be hard to stop using PKZip altogether since it's so prevalent.

No comments:

Post a Comment