Doboz is asymmetric (high compression ratio, fast decompression) LZ-based compression algorithm.
Originally Doboz was written by
. This library in a port (not wrapper) to .NET.
You can find latest release on NuGet
Why use such algorithm?
Like "Scope, Time, Cost" compression algorithms have their own triangle: "compression ratio, compression speed, decompression speed". If you want to achieve better results in one area you have to sacrifice something else.
Zip is "general purpose algorithms" which just tries to have average score in all aspects. But sometimes we need one aspect.
Asymmetric compression is used when one of the operation is used more frequently. For example,
- Fast compression speed sacrificing decompression speed - useful for backup software. You want to backup frequently, but you don't really care about decompression speed (you actually prefer to never use it!).
- Fast compression and decompression sacrificing compression ratio - useful for transmission through "large pipe" (Snappy,
- Fast decompression sacrificing compression speed - useful for compress-once-decompress-frequently; example being: distributing data. You compress it is once on your build machine (so you don't really care about compression speed) but it will
be decompressed many times (LZ4HC);
Doboz falls into third category.
On average, Doboz has the same compression as zip but is 3-6 times faster on decompression (and, to be honest, 4-5 times slower on compression).
Tests were done on Intel Core i5 3570K @ 4.2GHz (but only single core was used):
|Deflate (.NET 4.51)
1. NOTE: .NET 4.5 Deflate is finally properly implemented. It has the same compression ratio as zlib.
As you can see LZ4HC is faster but Doboz has better compression ratio. Doboz was also easier to port to .NET, so its safe implementation is almost as fast as LZ4's.
Anyway, I'm not overly impressed, I just ported it for myself and now I'm sharing it with you.