static U32 g_nbSeconds = NBSECONDS;
static size_t g_blockSize = 0;
int g_additionalParam = 0;
+int g_benchSeparately = 0;
void BMK_setNotificationLevel(unsigned level) { g_displayLevel=level; }
void BMK_setAdditionalParam(int additionalParam) { g_additionalParam=additionalParam; }
-void BMK_SetNbSeconds(unsigned nbSeconds)
+void BMK_setNbSeconds(unsigned nbSeconds)
{
g_nbSeconds = nbSeconds;
DISPLAYLEVEL(3, "- test >= %u seconds per compression / decompression -\n", g_nbSeconds);
}
-void BMK_SetBlockSize(size_t blockSize)
-{
- g_blockSize = blockSize;
-}
+void BMK_setBlockSize(size_t blockSize) { g_blockSize = blockSize; }
+
+void BMK_setBenchSeparately(int separate) { g_benchSeparately = (separate!=0); }
/* ********************************************************
}
+int BMK_benchFilesSeparately(const char** fileNamesTable, unsigned nbFiles,
+ int cLevel, int cLevelLast)
+{
+ unsigned fileNb;
+ if (cLevel > LZ4HC_CLEVEL_MAX) cLevel = LZ4HC_CLEVEL_MAX;
+ if (cLevelLast > LZ4HC_CLEVEL_MAX) cLevelLast = LZ4HC_CLEVEL_MAX;
+ if (cLevelLast < cLevel) cLevelLast = cLevel;
+ if (cLevelLast > cLevel) DISPLAYLEVEL(2, "Benchmarking levels from %d to %d\n", cLevel, cLevelLast);
+
+ for (fileNb=0; fileNb<nbFiles; fileNb++)
+ BMK_benchFileTable(fileNamesTable+fileNb, 1, cLevel, cLevelLast);
+
+ return 0;
+}
+
+
int BMK_benchFiles(const char** fileNamesTable, unsigned nbFiles,
int cLevel, int cLevelLast)
{
if (nbFiles == 0)
BMK_syntheticTest(cLevel, cLevelLast, compressibility);
- else
- BMK_benchFileTable(fileNamesTable, nbFiles, cLevel, cLevelLast);
+ else {
+ if (g_benchSeparately)
+ BMK_benchFilesSeparately(fileNamesTable, nbFiles, cLevel, cLevelLast);
+ else
+ BMK_benchFileTable(fileNamesTable, nbFiles, cLevel, cLevelLast);
+ }
return 0;
}
int cLevel, int cLevelLast);
/* Set Parameters */
-void BMK_SetNbSeconds(unsigned nbLoops);
-void BMK_SetBlockSize(size_t blockSize);
+void BMK_setNbSeconds(unsigned nbLoops);
+void BMK_setBlockSize(size_t blockSize);
void BMK_setAdditionalParam(int additionalParam);
void BMK_setNotificationLevel(unsigned level);
+void BMK_setBenchSeparately(int separate);
#endif /* BENCH_H_125623623633 */
if (B < 4) badusage(exeName);
if (B <= 7) {
blockSize = LZ4IO_setBlockSizeID(B);
- BMK_SetBlockSize(blockSize);
+ BMK_setBlockSize(blockSize);
DISPLAYLEVEL(2, "using blocks of size %u KB \n", (U32)(blockSize>>10));
} else {
if (B < 32) badusage(exeName);
- BMK_SetBlockSize(B);
+ BMK_setBlockSize(B);
if (B >= 1024) {
DISPLAYLEVEL(2, "bench: using blocks of size %u KB \n", (U32)(B>>10));
} else {
case 'b': mode = om_bench; multiple_inputs=1;
break;
+ /* hidden command : benchmark files, but do not fuse result */
+ case 'S': BMK_setBenchSeparately(1);
+ break;
+
#ifdef UTIL_HAS_CREATEFILELIST
/* recursive */
case 'r': recursive=1;
iters = readU32FromChar(&argument);
argument--;
BMK_setNotificationLevel(displayLevel);
- BMK_SetNbSeconds(iters); /* notification if displayLevel >= 3 */
+ BMK_setNbSeconds(iters); /* notification if displayLevel >= 3 */
}
break;