xref: /third_party/lz4/programs/bench.h (revision 27b27ec6)
127b27ec6Sopenharmony_ci/*
227b27ec6Sopenharmony_ci    bench.h - Demo program to benchmark open-source compression algorithm
327b27ec6Sopenharmony_ci    Copyright (C) Yann Collet 2012-2020
427b27ec6Sopenharmony_ci
527b27ec6Sopenharmony_ci    This program is free software; you can redistribute it and/or modify
627b27ec6Sopenharmony_ci    it under the terms of the GNU General Public License as published by
727b27ec6Sopenharmony_ci    the Free Software Foundation; either version 2 of the License, or
827b27ec6Sopenharmony_ci    (at your option) any later version.
927b27ec6Sopenharmony_ci
1027b27ec6Sopenharmony_ci    This program is distributed in the hope that it will be useful,
1127b27ec6Sopenharmony_ci    but WITHOUT ANY WARRANTY; without even the implied warranty of
1227b27ec6Sopenharmony_ci    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1327b27ec6Sopenharmony_ci    GNU General Public License for more details.
1427b27ec6Sopenharmony_ci
1527b27ec6Sopenharmony_ci    You should have received a copy of the GNU General Public License along
1627b27ec6Sopenharmony_ci    with this program; if not, write to the Free Software Foundation, Inc.,
1727b27ec6Sopenharmony_ci    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1827b27ec6Sopenharmony_ci
1927b27ec6Sopenharmony_ci    You can contact the author at :
2027b27ec6Sopenharmony_ci    - LZ4 source repository : https://github.com/lz4/lz4
2127b27ec6Sopenharmony_ci    - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c
2227b27ec6Sopenharmony_ci*/
2327b27ec6Sopenharmony_ci#ifndef BENCH_H_125623623633
2427b27ec6Sopenharmony_ci#define BENCH_H_125623623633
2527b27ec6Sopenharmony_ci
2627b27ec6Sopenharmony_ci#include <stddef.h>
2727b27ec6Sopenharmony_ci
2827b27ec6Sopenharmony_ci/* BMK_benchFiles() :
2927b27ec6Sopenharmony_ci * Benchmark all files provided through array @fileNamesTable.
3027b27ec6Sopenharmony_ci * All files must be valid, otherwise benchmark fails.
3127b27ec6Sopenharmony_ci * Roundtrip measurements are done for each file individually, but
3227b27ec6Sopenharmony_ci * unless BMK_setBenchSeparately() is set, all results are agglomerated.
3327b27ec6Sopenharmony_ci * The method benchmarks all compression levels from @cLevelStart to @cLevelLast,
3427b27ec6Sopenharmony_ci * both inclusive, providing one result per compression level.
3527b27ec6Sopenharmony_ci * If @cLevelLast <= @cLevelStart, BMK_benchFiles() benchmarks @cLevelStart only.
3627b27ec6Sopenharmony_ci * @dictFileName is optional, it's possible to provide NULL.
3727b27ec6Sopenharmony_ci * When provided, compression and decompression use the specified file as dictionary.
3827b27ec6Sopenharmony_ci * Only one dictionary can be provided, in which case it's applied to all benchmarked files.
3927b27ec6Sopenharmony_ci**/
4027b27ec6Sopenharmony_ciint BMK_benchFiles(const char** fileNamesTable, unsigned nbFiles,
4127b27ec6Sopenharmony_ci                   int cLevelStart, int cLevelLast,
4227b27ec6Sopenharmony_ci                   const char* dictFileName);
4327b27ec6Sopenharmony_ci
4427b27ec6Sopenharmony_ci/* Set Parameters */
4527b27ec6Sopenharmony_civoid BMK_setNbSeconds(unsigned nbSeconds);  /* minimum benchmark duration, in seconds, for both compression and decompression */
4627b27ec6Sopenharmony_civoid BMK_setBlockSize(size_t blockSize);    /* Internally cut input file(s) into independent blocks of specified size */
4727b27ec6Sopenharmony_civoid BMK_setNotificationLevel(unsigned level);  /* Influence verbosity level */
4827b27ec6Sopenharmony_civoid BMK_setBenchSeparately(int separate);  /* When providing multiple files, output one result per file */
4927b27ec6Sopenharmony_civoid BMK_setDecodeOnlyMode(int set);        /* v1.9.4+: set benchmark mode to decode only */
5027b27ec6Sopenharmony_civoid BMK_skipChecksums(int skip);           /* v1.9.4+: only useful for DecodeOnlyMode; do not calculate checksum when present, to save CPU time */
5127b27ec6Sopenharmony_ci
5227b27ec6Sopenharmony_civoid BMK_setAdditionalParam(int additionalParam); /* hidden param, influence output format, for python parsing */
5327b27ec6Sopenharmony_ci
5427b27ec6Sopenharmony_ci#endif   /* BENCH_H_125623623633 */
55