~mmach/netext73/lz4

« back to all changes in this revision

Viewing changes to programs/bench.h

  • Committer: mmach
  • Date: 2022-11-09 18:52:10 UTC
  • Revision ID: netbit73@gmail.com-20221109185210-w358idlhh0phq688
1.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
    bench.h - Demo program to benchmark open-source compression algorithm
3
 
    Copyright (C) Yann Collet 2012-2016
 
3
    Copyright (C) Yann Collet 2012-2020
4
4
 
5
5
    This program is free software; you can redistribute it and/or modify
6
6
    it under the terms of the GNU General Public License as published by
25
25
 
26
26
#include <stddef.h>
27
27
 
 
28
/* BMK_benchFiles() :
 
29
 * Benchmark all files provided through array @fileNamesTable.
 
30
 * All files must be valid, otherwise benchmark fails.
 
31
 * Roundtrip measurements are done for each file individually, but
 
32
 * unless BMK_setBenchSeparately() is set, all results are agglomerated.
 
33
 * The method benchmarks all compression levels from @cLevelStart to @cLevelLast,
 
34
 * both inclusive, providing one result per compression level.
 
35
 * If @cLevelLast <= @cLevelStart, BMK_benchFiles() benchmarks @cLevelStart only.
 
36
 * @dictFileName is optional, it's possible to provide NULL.
 
37
 * When provided, compression and decompression use the specified file as dictionary.
 
38
 * Only one dictionary can be provided, in which case it's applied to all benchmarked files.
 
39
**/
28
40
int BMK_benchFiles(const char** fileNamesTable, unsigned nbFiles,
29
 
                   int cLevel, int cLevelLast,
 
41
                   int cLevelStart, int cLevelLast,
30
42
                   const char* dictFileName);
31
43
 
32
44
/* Set Parameters */
33
 
void BMK_setNbSeconds(unsigned nbLoops);
34
 
void BMK_setBlockSize(size_t blockSize);
35
 
void BMK_setAdditionalParam(int additionalParam);
36
 
void BMK_setNotificationLevel(unsigned level);
37
 
void BMK_setBenchSeparately(int separate);
 
45
void BMK_setNbSeconds(unsigned nbSeconds);  /* minimum benchmark duration, in seconds, for both compression and decompression */
 
46
void BMK_setBlockSize(size_t blockSize);    /* Internally cut input file(s) into independent blocks of specified size */
 
47
void BMK_setNotificationLevel(unsigned level);  /* Influence verbosity level */
 
48
void BMK_setBenchSeparately(int separate);  /* When providing multiple files, output one result per file */
 
49
void BMK_setDecodeOnlyMode(int set);        /* v1.9.4+: set benchmark mode to decode only */
 
50
void BMK_skipChecksums(int skip);           /* v1.9.4+: only useful for DecodeOnlyMode; do not calculate checksum when present, to save CPU time */
 
51
 
 
52
void BMK_setAdditionalParam(int additionalParam); /* hidden param, influence output format, for python parsing */
38
53
 
39
54
#endif   /* BENCH_H_125623623633 */