Non-compression

What happens when you compress the noncompressable?


Preface

One day, while I was Bored (of course, I'm always Bored, but you know what I mean), I had an idea. I had created an empty file for testing something (I forgot what), and then I wondered what would happen if I compressed it.

Here's what.


The test

Contestants are sorted ascendingly by size. The empty file (“blah”) was created with touch blah. The test was done with Mac OS X 10.3.2, Mac OS 9.2.1, StuffIt Standard 8.0.2, StuffIt Deluxe 5.5, Compact Pro 1.33, bzip2 1.0.2, zip 2.1, zip 2.3, and GNU zip 1.2.4.

blah
Zero bytes. No compression. This is the original file.
blah.Z
Zero bytes. UNIX compress (StuffIt Deluxe 5.5).
blah.Z
Zero bytes. UNIX compress (compress from 4.3 BSD).
blah.bz2.1
14 bytes. bzip2 (StuffIt Deluxe 5.5).
blah.bz2
14 bytes. bzip2 (bzip2 1.0.2). bzip2 -9 (default).
blah.gz
25 bytes. GNU zip (gzip 1.2.4). gzip -9.
blah.cpt
65 bytes. Compact Pro (Compact Pro 1.33).
blah.sitx.1
80 bytes. StuffIt X (DropStuff 8.0.2). Method 1 (“Fastest Compression”), compression level 15 (of 15), memory consumption 20, encryption method DES, redundancy off, encoding off, optimizers on, blockmode on. NOTE 1.
blah.sitx.2
80 bytes. StuffIt X (DropStuff 8.0.2). Method 2 (“Best Binary Compression”), compression level 5 (of 5), memory consumption 20, encryption method DES, redundancy off, encoding off, optimizers on, blockmode on. NOTE 1.
blah.sitx.3
80 bytes. StuffIt X (DropStuff 8.0.2). Method 3 (“Best Size/Speed Trade-Off”), memory consumption 21, encryption method DES, redundancy off, encoding off, optimizers on, blockmode on. NOTE 1.
blah.sitx.4
80 bytes. StuffIt X (DropStuff 8.0.2). Method 4 (“Best Text Compression”), compression level 16 (of 16), memory consumption 20, encryption method DES, redundancy off, encoding off, optimizers on, blockmode on. NOTE 1.
blah.sitx.5
80 bytes. StuffIt X (DropStuff 8.0.2). Method 5 (“Choose by File Type”), compression level 16 (of 16), memory consumption 20, encryption method DES, redundancy off, encoding off, optimizers on, blockmode on. NOTE 1.
blah.sitx.6
80 bytes. StuffIt X (DropStuff 8.0.2). method 6 (“Choose by Analysis”), memory consumption 20, encryption method DES, redundancy off, encoding off, optimizers on, blockmode on. NOTE 1.
blah.sitx.7
80 bytes. StuffIt X (DropStuff 8.0.2). Method 2 (“Best Binary Compression”), compression level 1 (of 5), memory consumption 20, encryption method DES, redundancy off, encoding off, optimizers on, blockmode on. NOTE 1.
blah.zip.1
111 bytes. Zip (DropZip 8.0.2). Compression method “Deflate”, compression level 15 (of 15). NOTE 2.
blah.zip.3
134 bytes. Zip (zip 2.3). zip -9. NOTE 2.
blah.zip
134 bytes. Zip (zip 2.1). zip -9. NOTE 2.
blah.zip.2
140 bytes. Zip (StuffIt Deluxe 5.5). NOTE 2.
blah.sit
202 bytes. StuffIt 5.5 (DropStuff 8.0.2). “Best” compression. NOTE 3.
blah.sit.1
202 bytes. StuffIt 5.5 (StuffIt Deluxe 5.5). NOTE 3.

Notes

  1. The StuffIt X codecs seem to always return the same result when there's nothing to compress, no matter what compression options.
  2. The zip codecs, as you can see, vary significantly. Even two Aladdin codecs returned different results.
  3. StuffIt Deluxe's browser window reported that the file was 0 bytes UnStuffed, 88 bytes Stuffed. It also reported that the savings were “0%”.

Caveat

One thing worth noting is that the archive formats (zip and the two StuffIts) are guaranteed to lose this contest, because they must record the file's metadata (name, dates, permissions, etc.) as well as its (empty) contents. gzip, bzip2, and compress hold the advantage because they create a new file containing only the compressed contents.


Version history

2006-06-04
Changed sentences to begin with a capital letter. Changed HTML to XHTML.
2005-03-13
Initial publication.

2006-06-04 http://boredzo.org/koans/noncompression
Valid XHTML 1.0! Valid CSS!