bench.h 2.8 KB

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