summaryrefslogtreecommitdiffstats
path: root/programs/bench.h
diff options
context:
space:
mode:
authorReto Koradi <reto@fb.com>2019-11-04 19:51:41 (GMT)
committerReto Koradi <reto@fb.com>2019-11-06 07:38:00 (GMT)
commitcc91777c98d71194c9d29544f84880742ffdf86c (patch)
treea292c1082221dcf05549d1a88a3b6c36c93186d9 /programs/bench.h
parente8baeca51ef2003d6c9ec21c32f1563fef1065b9 (diff)
downloadlz4-cc91777c98d71194c9d29544f84880742ffdf86c.zip
lz4-cc91777c98d71194c9d29544f84880742ffdf86c.tar.gz
lz4-cc91777c98d71194c9d29544f84880742ffdf86c.tar.bz2
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.
Diffstat (limited to 'programs/bench.h')
-rw-r--r--programs/bench.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/programs/bench.h b/programs/bench.h
index bb67bee..22ebf60 100644
--- a/programs/bench.h
+++ b/programs/bench.h
@@ -26,7 +26,8 @@
#include <stddef.h>
int BMK_benchFiles(const char** fileNamesTable, unsigned nbFiles,
- int cLevel, int cLevelLast);
+ int cLevel, int cLevelLast,
+ const char* dictFileName);
/* Set Parameters */
void BMK_setNbSeconds(unsigned nbLoops);