test-compress-benchmark: test three cases (zeros, simple, semi-random)
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 7 Dec 2014 02:53:39 +0000 (21:53 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 11 Oct 2015 03:05:44 +0000 (23:05 -0400)
commit9f35e8b45894f7e201878e128ca371662a9dc63d
tree780276c43ce4e6209829f393260ea7d33e7db75b
parent4b5bc5396c090ee41c45cab9052372d296c4a2f4
test-compress-benchmark: test three cases (zeros, simple, semi-random)

Existing test would use highly-compressible repeatable
input. Two types of input are added:
- zeros
- random blocks interspersed with zeros

The idea is to get more information about behaviour in various cases.

On Intel Xeon the results are:

% ./test-compress-benchmark
XZ/zeros: compressed & decompressed 2535301373 bytes in 32.56s (74.26MiB/s), mean compresion 99.96%, skipped 3160 bytes
LZ4/zeros: compressed & decompressed 2535304362 bytes in 1.16s (2088.69MiB/s), mean compresion 99.60%, skipped 171 bytes
XZ/simple: compressed & decompressed 2535300963 bytes in 30.42s (79.48MiB/s), mean compresion 99.95%, skipped 3570 bytes
LZ4/simple: compressed & decompressed 2535303543 bytes in 1.22s (1978.86MiB/s), mean compresion 99.60%, skipped 990 bytes
XZ/random: compressed & decompressed 381756649 bytes in 60.02s (6.07MiB/s), mean compresion 39.64%, skipped 27813723 bytes
LZ4/random: compressed & decompressed 2507385036 bytes in 0.97s (2477.52MiB/s), mean compresion 54.77%, skipped 27919497 bytes

If someone has ideas for more realistic test cases, they can be easily
added to this framework.
src/journal/test-compress-benchmark.c