Compress

From Jonathan Gardner's Tech Wiki
Jump to: navigation, search

Compression refers to the compression of data.

Data can often be compressed. This trades CPU cycles (on both the compressing and decompressing processes) for bandwidth (disk space or network bandwidth.)

How do compression algorithms work? They work by encoding the data. The code basically explains the patterns in the original data. It's a recipe, in short, to recreate the original data.

What compression algorithms are there? The two that I am most familiar with are zip and bzip. There's also rzip, but I don't know of anyone actually using this yet. In my experience, zip is good enough. bzip gives you better compression (but not that much better) at the expense of taking many more CPU cycles.

Some data cannot be compressed, notable random data. This is because there aren't any patterns that can easily be found and explained. However, most of the real data people use--programs, text, images--can be compressed quite handsomely. Images compress so well that most image formats have compression as part of the specification. (See Image formats)