Make benchmark compatible with dictionary compression
authorReto Koradi <reto@fb.com>
Mon, 4 Nov 2019 19:51:41 +0000 (11:51 -0800)
committerReto Koradi <reto@fb.com>
Wed, 6 Nov 2019 07:38:00 +0000 (23:38 -0800)
commitcc91777c98d71194c9d29544f84880742ffdf86c
treea292c1082221dcf05549d1a88a3b6c36c93186d9
parente8baeca51ef2003d6c9ec21c32f1563fef1065b9
Make benchmark compatible with dictionary compression

Support the -D command line option for running benchmarks. The
benchmark code was slightly restructured to factor out the calls
that need to be different for each benchmark scenario. Since there
are now 4 scenarios (all combinations of fast/HC and with/without
dictionary), the logic was getting somewhat convoluted otherwise.

This was done by extending the compressionParameters struct that
previously contained just a single function pointer. It now
contains 4 function pointers for init/reset/compress/cleanup,
with the related state. The functions get a pointer to the
structure as their first argument (inspired by C++), so that they
can access the state values in the struct.
programs/bench.c
programs/bench.h
programs/lz4cli.c