2013-12-31 01:16:52 +08:00
|
|
|
/*
|
|
|
|
bench.h - Demo program to benchmark open-source compression algorithm
|
2020-11-26 06:45:14 +08:00
|
|
|
Copyright (C) Yann Collet 2012-2020
|
2013-12-31 01:16:52 +08:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
|
|
|
You can contact the author at :
|
2016-11-03 22:12:57 +08:00
|
|
|
- LZ4 source repository : https://github.com/lz4/lz4
|
2015-03-13 09:24:08 +08:00
|
|
|
- LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c
|
2013-12-31 01:16:52 +08:00
|
|
|
*/
|
2016-11-04 21:26:12 +08:00
|
|
|
#ifndef BENCH_H_125623623633
|
|
|
|
#define BENCH_H_125623623633
|
2013-12-31 01:16:52 +08:00
|
|
|
|
2016-11-04 21:26:12 +08:00
|
|
|
#include <stddef.h>
|
2013-12-31 01:16:52 +08:00
|
|
|
|
2022-07-29 20:51:52 +08:00
|
|
|
/* 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.
|
|
|
|
**/
|
2016-11-04 21:26:12 +08:00
|
|
|
int BMK_benchFiles(const char** fileNamesTable, unsigned nbFiles,
|
2022-07-29 20:51:52 +08:00
|
|
|
int cLevelStart, int cLevelLast,
|
2019-11-05 03:51:41 +08:00
|
|
|
const char* dictFileName);
|
2013-12-31 01:16:52 +08:00
|
|
|
|
2014-12-07 00:10:54 +08:00
|
|
|
/* Set Parameters */
|
2022-07-29 20:51:52 +08:00
|
|
|
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 */
|
2022-07-30 00:57:36 +08:00
|
|
|
void BMK_setDecodeOnlyMode(int set); /* v1.9.4+: set benchmark mode to decode only */
|
2022-07-30 04:13:38 +08:00
|
|
|
void BMK_skipChecksums(int skip); /* v1.9.4+: only useful for DecodeOnlyMode; do not calculate checksum when present, to save CPU time */
|
2022-07-29 20:51:52 +08:00
|
|
|
|
|
|
|
void BMK_setAdditionalParam(int additionalParam); /* hidden param, influence output format, for python parsing */
|
2013-12-31 01:16:52 +08:00
|
|
|
|
2016-11-04 21:26:12 +08:00
|
|
|
#endif /* BENCH_H_125623623633 */
|