From df4bb410e31b913328687bc8b04a3f39f79efc8d Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Fri, 29 Jul 2022 14:51:52 +0200 Subject: updated documentation of bench unit --- programs/bench.c | 4 ++-- programs/bench.h | 25 +++++++++++++++++++------ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/programs/bench.c b/programs/bench.c index 242946d..85bf87a 100644 --- a/programs/bench.c +++ b/programs/bench.c @@ -677,7 +677,8 @@ static void BMK_syntheticTest(int cLevel, int cLevelLast, double compressibility } -int BMK_benchFilesSeparately(const char** fileNamesTable, unsigned nbFiles, +static int +BMK_benchFilesSeparately(const char** fileNamesTable, unsigned nbFiles, int cLevel, int cLevelLast, const char* dictBuf, int dictSize) { @@ -685,7 +686,6 @@ int BMK_benchFilesSeparately(const char** fileNamesTable, unsigned nbFiles, if (cLevel > LZ4HC_CLEVEL_MAX) cLevel = LZ4HC_CLEVEL_MAX; if (cLevelLast > LZ4HC_CLEVEL_MAX) cLevelLast = LZ4HC_CLEVEL_MAX; if (cLevelLast < cLevel) cLevelLast = cLevel; - if (cLevelLast > cLevel) DISPLAYLEVEL(2, "Benchmarking levels from %d to %d\n", cLevel, cLevelLast); for (fileNb=0; fileNb +/* BMK_benchFiles() : + * Benchmark all files provided through array @fileNamesTable. + * All files must be valid, otherwise benchmark fails. + * Roundtrip measurements are done for each file individually, but + * unless BMK_setBenchSeparately() is set, all results are agglomerated. + * The method benchmarks all compression levels from @cLevelStart to @cLevelLast, + * both inclusive, providing one result per compression level. + * If @cLevelLast <= @cLevelStart, BMK_benchFiles() benchmarks @cLevelStart only. + * @dictFileName is optional, it's possible to provide NULL. + * When provided, compression and decompression use the specified file as dictionary. + * Only one dictionary can be provided, in which case it's applied to all benchmarked files. +**/ int BMK_benchFiles(const char** fileNamesTable, unsigned nbFiles, - int cLevel, int cLevelLast, + int cLevelStart, int cLevelLast, const char* dictFileName); /* Set Parameters */ -void BMK_setNbSeconds(unsigned nbLoops); -void BMK_setBlockSize(size_t blockSize); -void BMK_setAdditionalParam(int additionalParam); -void BMK_setNotificationLevel(unsigned level); -void BMK_setBenchSeparately(int separate); +void BMK_setNbSeconds(unsigned nbSeconds); /* minimum benchmark duration, in seconds, for both compression and decompression */ +void BMK_setBlockSize(size_t blockSize); /* Internally cut input file(s) into independent blocks of specified size */ +void BMK_setNotificationLevel(unsigned level); /* Influence verbosity level */ +void BMK_setBenchSeparately(int separate); /* When providing multiple files, output one result per file */ + +void BMK_setAdditionalParam(int additionalParam); /* hidden param, influence output format, for python parsing */ #endif /* BENCH_H_125623623633 */ -- cgit v0.12