1*27162e4eSAndroid Build Coastguard Worker /* 2*27162e4eSAndroid Build Coastguard Worker bench.h - Demo program to benchmark open-source compression algorithm 3*27162e4eSAndroid Build Coastguard Worker Copyright (C) Yann Collet 2012-2020 4*27162e4eSAndroid Build Coastguard Worker 5*27162e4eSAndroid Build Coastguard Worker This program is free software; you can redistribute it and/or modify 6*27162e4eSAndroid Build Coastguard Worker it under the terms of the GNU General Public License as published by 7*27162e4eSAndroid Build Coastguard Worker the Free Software Foundation; either version 2 of the License, or 8*27162e4eSAndroid Build Coastguard Worker (at your option) any later version. 9*27162e4eSAndroid Build Coastguard Worker 10*27162e4eSAndroid Build Coastguard Worker This program is distributed in the hope that it will be useful, 11*27162e4eSAndroid Build Coastguard Worker but WITHOUT ANY WARRANTY; without even the implied warranty of 12*27162e4eSAndroid Build Coastguard Worker MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13*27162e4eSAndroid Build Coastguard Worker GNU General Public License for more details. 14*27162e4eSAndroid Build Coastguard Worker 15*27162e4eSAndroid Build Coastguard Worker You should have received a copy of the GNU General Public License along 16*27162e4eSAndroid Build Coastguard Worker with this program; if not, write to the Free Software Foundation, Inc., 17*27162e4eSAndroid Build Coastguard Worker 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18*27162e4eSAndroid Build Coastguard Worker 19*27162e4eSAndroid Build Coastguard Worker You can contact the author at : 20*27162e4eSAndroid Build Coastguard Worker - LZ4 source repository : https://github.com/lz4/lz4 21*27162e4eSAndroid Build Coastguard Worker - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c 22*27162e4eSAndroid Build Coastguard Worker */ 23*27162e4eSAndroid Build Coastguard Worker #ifndef BENCH_H_125623623633 24*27162e4eSAndroid Build Coastguard Worker #define BENCH_H_125623623633 25*27162e4eSAndroid Build Coastguard Worker 26*27162e4eSAndroid Build Coastguard Worker #include <stddef.h> 27*27162e4eSAndroid Build Coastguard Worker 28*27162e4eSAndroid Build Coastguard Worker /* BMK_benchFiles() : 29*27162e4eSAndroid Build Coastguard Worker * Benchmark all files provided through array @fileNamesTable. 30*27162e4eSAndroid Build Coastguard Worker * All files must be valid, otherwise benchmark fails. 31*27162e4eSAndroid Build Coastguard Worker * Roundtrip measurements are done for each file individually, but 32*27162e4eSAndroid Build Coastguard Worker * unless BMK_setBenchSeparately() is set, all results are agglomerated. 33*27162e4eSAndroid Build Coastguard Worker * The method benchmarks all compression levels from @cLevelStart to @cLevelLast, 34*27162e4eSAndroid Build Coastguard Worker * both inclusive, providing one result per compression level. 35*27162e4eSAndroid Build Coastguard Worker * If @cLevelLast <= @cLevelStart, BMK_benchFiles() benchmarks @cLevelStart only. 36*27162e4eSAndroid Build Coastguard Worker * @dictFileName is optional, it's possible to provide NULL. 37*27162e4eSAndroid Build Coastguard Worker * When provided, compression and decompression use the specified file as dictionary. 38*27162e4eSAndroid Build Coastguard Worker * Only one dictionary can be provided, in which case it's applied to all benchmarked files. 39*27162e4eSAndroid Build Coastguard Worker **/ 40*27162e4eSAndroid Build Coastguard Worker int BMK_benchFiles(const char** fileNamesTable, unsigned nbFiles, 41*27162e4eSAndroid Build Coastguard Worker int cLevelStart, int cLevelLast, 42*27162e4eSAndroid Build Coastguard Worker const char* dictFileName); 43*27162e4eSAndroid Build Coastguard Worker 44*27162e4eSAndroid Build Coastguard Worker /* Set Parameters */ 45*27162e4eSAndroid Build Coastguard Worker void BMK_setNbSeconds(unsigned nbSeconds); /* minimum benchmark duration, in seconds, for both compression and decompression */ 46*27162e4eSAndroid Build Coastguard Worker void BMK_setBlockSize(size_t blockSize); /* Internally cut input file(s) into independent blocks of specified size */ 47*27162e4eSAndroid Build Coastguard Worker void BMK_setNotificationLevel(unsigned level); /* Influence verbosity level */ 48*27162e4eSAndroid Build Coastguard Worker void BMK_setBenchSeparately(int separate); /* When providing multiple files, output one result per file */ 49*27162e4eSAndroid Build Coastguard Worker void BMK_setDecodeOnlyMode(int set); /* v1.9.4+: set benchmark mode to decode only */ 50*27162e4eSAndroid Build Coastguard Worker void BMK_skipChecksums(int skip); /* v1.9.4+: only useful for DecodeOnlyMode; do not calculate checksum when present, to save CPU time */ 51*27162e4eSAndroid Build Coastguard Worker 52*27162e4eSAndroid Build Coastguard Worker void BMK_setAdditionalParam(int additionalParam); /* hidden param, influence output format, for python parsing */ 53*27162e4eSAndroid Build Coastguard Worker 54*27162e4eSAndroid Build Coastguard Worker #endif /* BENCH_H_125623623633 */ 55