Hacker Newsnew | comments | show | ask | jobs | submit login

They claim in the README that Snappy is usually faster than QuickLZ. Haven't tested myself, though.



They compare with QuickLZ 1.0 from 2006 (you can see that from snappy_unittest.cc).

I've done a quick benchmark with the files on quicklz.com on the same machine with QuickLZ 1.5.0:

test file; library; compressed size; compression speed in mb/s

average QuickLZ 47.9% 308 snappy 53.0% 261

proteins.txt QuickLZ 1.5.0 35.6% 331 snappy 40.5% 232

plaintext.txt   QuickLZ 1.5.0 48.1% 245 snappy 55.5% 193

gdb.exe   QuickLZ 1.5.0 45.8% 270 snappy 51.1% 214

flower.bmp QuickLZ 1.5.0 86.7% snappy 91.5% 208

northwind.mdf QuickLZ 1.5.0 23.2% snappy 26.4% 456

-----


Hi,

I work at Google, and I've been working on the Snappy open-sourcing. First of all, let me state that when doing our benchmarks, we were definitely comparing against the latest public version (1.5.0) of QuickLZ. I'm having problems reproducing your benchmark results; could you provide some more details about the exact settings, compiler version, architecture etc.? I can't even get all of the compression ratios to match up exactly with the ones I'm seeing, so there must be some sort of difference between the setups. Are you perchance running Snappy with assertions enabled? (The microbenchmark will complain if you do, so it's easy to check.)

For what it's worth, I ran the QuickLZ test suite on my own machine (you can see the exact testing environment below), and got quite different results:

  qlz-testsuite/flower.bmp                 :
  QUICKLZ: [b 1M] bytes 5922816 -> 5087471 85.9%  comp 132.4 MB/s  uncomp 140.8 MB/s
  SNAPPY: [b 4M] bytes 5922816 -> 5369439 90.7%  comp 180.6 MB/s  uncomp 484.0 MB/s
  qlz-testsuite/gdb.exe                    :
  QUICKLZ: [b 1M] bytes 8872609 -> 4074990 45.9%  comp 177.4 MB/s  uncomp 213.3 MB/s
  SNAPPY: [b 4M] bytes 8872609 -> 4530851 51.1%  comp 224.7 MB/s  uncomp 468.7 MB/s
  qlz-testsuite/northwind.mdf              :
  QUICKLZ: [b 1M] bytes 2752512 -> 628607 22.8%  comp 291.3 MB/s  uncomp 409.6 MB/s
  SNAPPY: [b 4M] bytes 2752512 -> 726437 26.4%  comp 456.6 MB/s  uncomp 790.1 MB/s
  qlz-testsuite/plaintext.txt              :
  QUICKLZ: [b 1M] bytes 2899483 -> 1436466 49.5%  comp 155.4 MB/s  uncomp 182.7 MB/s
  SNAPPY: [b 4M] bytes 2899483 -> 1629408 56.2%  comp 195.2 MB/s  uncomp 487.5 MB/s
  qlz-testsuite/proteins.txt               :
  QUICKLZ: [b 1M] bytes 7254685 -> 2600129 35.8%  comp 218.2 MB/s  uncomp 261.2 MB/s
  SNAPPY: [b 4M] bytes 7254685 -> 2934406 40.4%  comp 269.4 MB/s  uncomp 556.9 MB/s

  Average compression ratio (geometric mean, lower is better): QuickLZ 43.7%, Snappy 48.9%.
  Average compression speed (harmonic mean): QuickLZ 180.9 MB/s, Snappy 238.0 MB/s.
  Average decompresion speed (harmonic mean): QuickLZ 212.5 MB/s, Snappy 536.9 MB/s.
In addition, there's one nearly-incompressible file listed on the same page, which I also ran on (it's not included in the averages above):

  qlz-testsuite/NotTheMusic.mp4            :
  QUICKLZ: [b 1M] bytes 9832475 -> 9832565 100.0%  comp 289.3 MB/s  uncomp 2815.9 MB/s
  SNAPPY: [b 4M] bytes 9832475 -> 9485433 96.5%  comp 1308.4 MB/s  uncomp 2477.1 MB/s
This is on a Nehalem 2.27GHz, running Debian GNU/Linux 6.0 in 64-bit mode, GCC version 4.4.5, with flags -O2 -g -DNDEBUG for both Snappy (1.0.0) and QuickLZ (1.5.0), running snappy_unittest to compare. QuickLZ was left at the default settings, ie. the files were exactly as downloaded from http://www.quicklz.com/quicklz.[ch] as of today. In particular, this means QuickLZ was running in unsafe mode, which means it could crash on corrupted compressed input. (Safe mode, which is comparable to how Snappy runs, is, according to http://www.quicklz.com/download.html, 15–20% slower at decompression, so the difference would be bigger.)

Exact benchmark results will, as always, vary with differing compiler, set of flags, CPU, and data set. The average numbers from this benchmark, however, show QuickLZ 1.5.0 (in unsafe mode) compressing about 11% more densely than Snappy 1.0.0 does, but Snappy compressing about 32% faster and decompressing about 153% faster (ie., about 2.53 times as fast).

/* Steinar */

-----


Sorry, had assertions on. Getting same results now (using my own benchmark function though)

Benchmarking: benchdata/northwind.mdf

snappy: Compressed 2752512 bytes into 726437 (26.4%) at 653.0 MiB/s

QuickLZ: Compressed 2752512 bytes into 620933 (22.6%) at 456.8 MiB/s

Benchmarking: benchdata/gdb.exe

snappy: Compressed 8872609 bytes into 4530844 (51.1%) at 333.1 MiB/s

QuickLZ: Compressed 8872609 bytes into 4056279 (45.7%) at 267.6 MiB/s

Benchmarking: benchdata/pic.bmp

snappy: Compressed 18108198 bytes into 16561772 (91.5%) at 292.5 MiB/s

QuickLZ: Compressed 18108198 bytes into 15784615 (87.2%) at 197.2 MiB/s

Benchmarking: benchdata/plaintext.txt

snappy: Compressed 2988604 bytes into 1657747 (55.5%) at 289.4 MiB/s

QuickLZ: Compressed 2988604 bytes into 1436646 (48.1%) at 238.5 MiB/s

Benchmarking: benchdata/proteins.txt

snappy: Compressed 7344249 bytes into 2964303 (40.4%) at 371.6 MiB/s

QuickLZ: Compressed 7344249 bytes into 2586659 (35.2%) at 321.9 MiB/s

-----




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: