File:
* arial.ttf (367112 B) - quite good match for typical data
Test method:
* doing every action twice and timing only on the second time to eliminate cache effects.
* tests come in pairs: packing and then unpacking the result
* times are given in CPU clock cycles (ie. __rdtsc).
* all results have been verified by memcmp + data length ("OK!").
* time fraction is given compared to LZO (packFast & unpack).
Results:
* 32bit target
* full optimizations (link time codegen, __fastcall, etc)
Code:
LZO pack fast : T 12946703 ( 0.998) 248355 (0.677)
LZO unpack : T 2383290 ( 1.000) OK!
LZO pack well : T 152666078 (11.772) 216378 (0.589)
LZO unpack : T 2849355 ( 1.196) OK!
FastLZ pack fast : T 8414670 ( 0.649) 251407 (0.685)
FastLZ unpack : T 2930790 ( 1.230) OK!
FastLZ pack well : T 8443125 ( 0.651) 251407 (0.685)
FastLZ unpack : T 2931443 ( 1.230) OK!
LibZF pack fast : T 6640260 ( 0.512) 249666 (0.680)
LibZF unpack : T 2358060 ( 0.990) OK!
Snappy pack fast : T 8971065 ( 0.692) 258600 (0.704)
Snappy unpack : T 1797510 ( 0.754) OK!
* 64bit target
* full optimizations (link time codegen, __fastcall, etc)
Code:
LZO pack fast : T 14421023 ( 1.016) 248355 (0.677)
LZO unpack : T 2402130 ( 1.000) OK!
LZO pack well : T 135855637 ( 9.568) 216378 (0.589)
LZO unpack : T 2857927 ( 1.190) OK!
FastLZ pack fast : T 7763407 ( 0.547) 251407 (0.685)
FastLZ unpack : T 2835637 ( 1.181) OK!
FastLZ pack well : T 7762125 ( 0.547) 251407 (0.685)
FastLZ unpack : T 2835847 ( 1.181) OK!
LibZF pack fast : T 6416865 ( 0.452) 249666 (0.680)
LibZF unpack : T 2459917 ( 1.024) OK!
Snappy pack fast : T 10050075 ( 0.708) 258600 (0.704)
Snappy unpack : T 1641833 ( 0.684) OK!
Snappy is WAY faster at unpacking than anything else! However - compression ratio is also the worst.
Packing efficiency is quite equal among them all - except LZO slow packing which is much better than anything else :/ ... yeah, it was perfect for baking data.
Notes:
* LibLZ has some compile time options i did not tamper with.
* Snappy causes a LOT of warnings.
* Snappy does not compile under VC++ at all due of errors - threw away all "inline" etc that caused problems (link time codegen should remedy that i think).
* FastLZ, LibZF & Snappy seem to be unaware of 64bit target - lots of 64bit incompatibility related warnings.