rzip vs. bzip2 – A short comparison

I decided to benchmark rzip against bzip2 for my backup needs. The benchmark was performed on an 89M tar archive of a directory that I regularly back up using my Amazon S3 backup script. The directory contains mostly LaTeX, PDF, and OpenOffice files, so this benchmark may reflect very different results from what you would get if you tested it on other kinds of files.

I ran both rzip and bzip2 with their default settings. bzip2, the program I currently use for my backups, managed to compress the tar file to 43.5M in 1:4.286 (min:sec). On the other hand, rzip compressed the tar to a mere 39M and did so in only 32.844 seconds.

When weighing the results based only on the resulting compressed file size and processing time, rzip beats bzip2 by far. It has superior compression abilities, and rzip does it twice as fast as bzip2.

One must note that rzip was much more memory-intensive, so it isn’t suited for environments that are low on available memory. Another disadvantage of rzip is that it can’t operate on stdin/stdout, so one must first physically create the file on the disk before compressing it.

As I don’t have any memory shortage on my machine (especially during the night when I make my backups), and I can live with creating a temporary tar file, I plan to switch my backup script over to use rzip. The new script will probably work very similarly to the current one, except it will produce an rzip-compressed archive, which will help me cut down the cost of backups.

One thought on “rzip vs. bzip2 – A short comparison”

  1. I tested rzip on a directory of 3186 files of saved webpages, mostly
    news articles, in the .mht format. One .mht file for each webpage
    containing html, pictures, js/css-files etc. Since the same pictures
    are used on many pages, rzip should be ideal for this task.

    I first tar’ed the directory into webpages.tar resulting in a 1077 MB file.

    gzip redused the size to 515 MB in 1m 19s

    bzip2 to 511 MB in 3m 59s

    rzip to just 247 MB in 2m 19s

    Using the -9 option (best compression) rzip returned 236 MB in 2m
    37s. It did however use nearly one gigabyte of memory at most. Not a
    problem on new powerful computers, but still worth mentioning.

    I suspect rzip would do even better with smart sorting of the files
    inside the .tar-file.

Leave a Reply

Your email address will not be published. Required fields are marked *