can select validation of CRC during benchmark
on command line, using existing long command --no-frame-crc. Note : it's effectively more than that, since _all_ checksums are disabled.
This commit is contained in:
@@ -1959,11 +1959,11 @@ size_t LZ4F_decompress(LZ4F_dctx* dctx,
|
||||
(void)readCRC;
|
||||
(void)resultCRC;
|
||||
#endif
|
||||
nextSrcSizeHint = 0;
|
||||
LZ4F_resetDecompressionContext(dctx);
|
||||
doAnotherStage = 0;
|
||||
break;
|
||||
}
|
||||
nextSrcSizeHint = 0;
|
||||
LZ4F_resetDecompressionContext(dctx);
|
||||
doAnotherStage = 0;
|
||||
break;
|
||||
|
||||
case dstage_getSFrameSize:
|
||||
if ((srcEnd - srcPtr) >= 4) {
|
||||
|
@@ -123,6 +123,7 @@ static size_t g_blockSize = 0;
|
||||
int g_additionalParam = 0;
|
||||
int g_benchSeparately = 0;
|
||||
int g_decodeOnly = 0;
|
||||
unsigned g_skipChecksums = 0;
|
||||
|
||||
void BMK_setNotificationLevel(unsigned level) { g_displayLevel=level; }
|
||||
|
||||
@@ -140,6 +141,8 @@ void BMK_setBenchSeparately(int separate) { g_benchSeparately = (separate!=0); }
|
||||
|
||||
void BMK_setDecodeOnlyMode(int set) { g_decodeOnly = (set!=0); }
|
||||
|
||||
void BMK_skipChecksums(int skip) { g_skipChecksums = (skip!=0); }
|
||||
|
||||
|
||||
/* *************************************
|
||||
* Compression state management
|
||||
@@ -318,10 +321,11 @@ LZ4F_decompress_binding(const char* src, char* dst,
|
||||
{
|
||||
size_t dstSize = (size_t)dstCapacity;
|
||||
size_t readSize = (size_t)srcSize;
|
||||
LZ4F_decompressOptions_t const dOpt = { 1, g_skipChecksums, 0, 0 };
|
||||
size_t const decStatus = LZ4F_decompress(g_dctx,
|
||||
dst, &dstSize,
|
||||
src, &readSize,
|
||||
NULL /* dOptPtr */);
|
||||
&dOpt);
|
||||
if ( (decStatus == 0) /* decompression successful */
|
||||
&& ((int)readSize==srcSize) /* consume all input */ )
|
||||
return (int)dstSize;
|
||||
@@ -775,7 +779,12 @@ int BMK_benchFiles(const char** fileNamesTable, unsigned nbFiles,
|
||||
|
||||
if (cLevel > LZ4HC_CLEVEL_MAX) cLevel = LZ4HC_CLEVEL_MAX;
|
||||
if (g_decodeOnly) {
|
||||
DISPLAYLEVEL(2, "Benchmark Decompression (only) of LZ4 Frame \n");
|
||||
DISPLAYLEVEL(2, "Benchmark Decompression of LZ4 Frame ");
|
||||
if (g_skipChecksums) {
|
||||
DISPLAYLEVEL(2, "_without_ checksum even when present \n");
|
||||
} else {
|
||||
DISPLAYLEVEL(2, "+ Checksum when present \n");
|
||||
}
|
||||
cLevelLast = cLevel;
|
||||
}
|
||||
if (cLevelLast > LZ4HC_CLEVEL_MAX) cLevelLast = LZ4HC_CLEVEL_MAX;
|
||||
|
@@ -47,6 +47,7 @@ void BMK_setBlockSize(size_t blockSize); /* Internally cut input file(s) into
|
||||
void BMK_setNotificationLevel(unsigned level); /* Influence verbosity level */
|
||||
void BMK_setBenchSeparately(int separate); /* When providing multiple files, output one result per file */
|
||||
void BMK_setDecodeOnlyMode(int set); /* v1.9.4+: set benchmark mode to decode only */
|
||||
void BMK_skipChecksums(int skip); /* v1.9.4+: only useful for DecodeOnlyMode; do not calculate checksum when present, to save CPU time */
|
||||
|
||||
void BMK_setAdditionalParam(int additionalParam); /* hidden param, influence output format, for python parsing */
|
||||
|
||||
|
@@ -389,8 +389,8 @@ int main(int argc, const char** argv)
|
||||
if (!strcmp(argument, "--no-force")) { LZ4IO_setOverwrite(prefs, 0); continue; }
|
||||
if ((!strcmp(argument, "--stdout"))
|
||||
|| (!strcmp(argument, "--to-stdout"))) { forceStdout=1; output_filename=stdoutmark; continue; }
|
||||
if (!strcmp(argument, "--frame-crc")) { LZ4IO_setStreamChecksumMode(prefs, 1); continue; }
|
||||
if (!strcmp(argument, "--no-frame-crc")) { LZ4IO_setStreamChecksumMode(prefs, 0); continue; }
|
||||
if (!strcmp(argument, "--frame-crc")) { LZ4IO_setStreamChecksumMode(prefs, 1); BMK_skipChecksums(0); continue; }
|
||||
if (!strcmp(argument, "--no-frame-crc")) { LZ4IO_setStreamChecksumMode(prefs, 0); BMK_skipChecksums(1); continue; }
|
||||
if (!strcmp(argument, "--content-size")) { LZ4IO_setContentSize(prefs, 1); continue; }
|
||||
if (!strcmp(argument, "--no-content-size")) { LZ4IO_setContentSize(prefs, 0); continue; }
|
||||
if (!strcmp(argument, "--list")) { mode = om_list; continue; }
|
||||
|
Reference in New Issue
Block a user