What’s the ‘best’ file compression method?

2007 March 9
by dimeotane

I’ve been doing a little bit of research into the best compression method to use in Ubuntu. There’s so many compression types when I right click –> create archive. Keep in mind that I’m simply using the default compression values right from the desktop, there’s no special tweaking involved here. Mainly, I want something quick and easy for every day file management. Many of these formats, I’ve seen before and had heard some were ‘better than others’; some faster, and some compress more. I really wasn’t sure what’s the best option.

I often have large data files (hudreds of megs or larger) that I like to make backup copy of, but would rather store them in a compressed format. I also don’t want to wait around forever to get the job done. I’m working on a fast machine (duo core 2) with a gig of memory.

So what’s gave me the ‘best’ results when compressing my 1.4 gb file? It’s a virtualbox .vdi file, essentially the entire HD for a windows 2000 virtual machine. The results could be very different on a collection of lots of small little files… something I might test later. In the mean time there’s a good study already published here.

Here’s my test results of several different formats on the file:

compress.png

Best compression – size in MB.

  1. 7z 493
  2. rar 523
  3. bz2 592
  4. lzh 607
  5. gz 614
  6. Z 614
  7. zip 614
  8. .arj 615
  9. lzo 737
  10. zoo 890

Best Time in seconds

  1. zip 175
  2. zoo 186
  3. arj 253
  4. lzo 295
  5. Z 300
  6. gz 344
  7. lzh 657
  8. bz2 706
  9. rar 840
  10. 7z 896

Conclusions:

It came as a surprise to me that plain old .zip to which I am quite familiar with already, is still a better choice for high compression of large data files in a short amount of time.

.arj and .Z and .gz all compress about as much, but just not as fast as .zip

I’ve heard really good things about .7z and it’s ability for high compression, and it does show in the results.  Both .z7 and .rar are able to use the duo core processor better (cpu use at 77%-90% compared to 55% for the others) yet take much longer than anything else to compress. If the file were being uploaded onto the internet, perhaps I would choose for the highest compression even it it takes 4 times longer.

I had read that .lzo and .zoo were good (some people claimed they were better) and fast with high compression, but I just don’t see that here at all.  They’re way off the mark.

So whats the best option?

.zip for quick and compatible compression.

.rar for high compression and compatiblity, when you have the time to wait.

.z7 for maximum compression when you have the time to wait.

10 Responses leave one →
  1. 2007 June 8

    Some compression tools (e.g. lzo) are so fast that the process is typically I/O bound. Did you test the *complete* compression time? Or did you use ‘time’ and see the process time only (excluding I/O)?

  2. 2007 December 2
    ThA_KillA permalink

    I USE .UHA and .7z for big files, but i takes a lot of time at the high compression method. It can make 1gb to 200mb or 100mb.

  3. 2008 January 24
    snerd permalink

    “…that plain old .zip to which I am quite familiar with already, is still a better choice…”

    =

    “… that plain old .zip with which I am already quite familiar is still a better choice…”

    The grammar check on your word processor is obviously broken.

  4. 2008 July 6
    pranay permalink

    There is one more_KGB archiver.It has the best compression but takes the most time.
    eg on a 512 mb ram computer to compress 25 mb it will take 2 hrs.

  5. 2008 July 6

    Cool. Thanks!

  6. 2008 July 26

    wtf WInrAR STore Compression method is the best =)

  7. 2008 September 4
    Sora permalink

    well in all there are a few others that are not used nearly as often as others one for example is the KGB archive which works better than 7zip and is slightly faster than 7zip but only by a few seconds or two

  8. 2008 September 11
    someguy permalink

    hopefully you’ll find this as helpful as I did.

    http://www.codinghorror.com/blog/archives/000798.html

  9. 2009 February 21
    Ben permalink

    I have been using zip for the same thing, compressing virtualbox files, but there seems to be filesize limit that zip can handle (2/4GB). It seems to just ignore them, giving the impression that they were included, but on inspecting the archive they are missing. I have heard rzip is designed for larger files, but until it becomes an option in fileroller (installed the rzip package for command line use) I think I will have to use bz2.

  10. 2009 July 13
    woot permalink

    Thank you ! this was exacty what i was looking for !
    thanks once again for the time and effort you spent on this litel project !

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS