removed pretty-print of sizes in benchmark
This is less appropriate for this mode : benchmark is about accuracy, it's important to read the exact values.dev
parent
71076b7a01
commit
eab692211e
|
@ -987,7 +987,7 @@ ZSTD_compressBlock_opt_generic(ZSTD_matchState_t* ms,
|
||||||
* in every price. We include the literal length to avoid negative
|
* in every price. We include the literal length to avoid negative
|
||||||
* prices when we subtract the previous literal length.
|
* prices when we subtract the previous literal length.
|
||||||
*/
|
*/
|
||||||
opt[0].price = ZSTD_litLengthPrice(litlen, optStatePtr, optLevel);
|
opt[0].price = (int)ZSTD_litLengthPrice(litlen, optStatePtr, optLevel);
|
||||||
|
|
||||||
/* large match -> immediate encoding */
|
/* large match -> immediate encoding */
|
||||||
{ U32 const maxML = matches[nbMatches-1].len;
|
{ U32 const maxML = matches[nbMatches-1].len;
|
||||||
|
@ -1007,6 +1007,7 @@ ZSTD_compressBlock_opt_generic(ZSTD_matchState_t* ms,
|
||||||
} }
|
} }
|
||||||
|
|
||||||
/* set prices for first matches starting position == 0 */
|
/* set prices for first matches starting position == 0 */
|
||||||
|
assert(opt[0].price >= 0);
|
||||||
{ U32 const literalsPrice = opt[0].price + ZSTD_litLengthPrice(0, optStatePtr, optLevel);
|
{ U32 const literalsPrice = opt[0].price + ZSTD_litLengthPrice(0, optStatePtr, optLevel);
|
||||||
U32 pos;
|
U32 pos;
|
||||||
U32 matchNb;
|
U32 matchNb;
|
||||||
|
|
|
@ -181,7 +181,7 @@ BMK_initCCtx(ZSTD_CCtx* ctx,
|
||||||
CHECK_Z(ZSTD_CCtx_setParameter(ctx, ZSTD_c_minMatch, (int)comprParams->minMatch));
|
CHECK_Z(ZSTD_CCtx_setParameter(ctx, ZSTD_c_minMatch, (int)comprParams->minMatch));
|
||||||
CHECK_Z(ZSTD_CCtx_setParameter(ctx, ZSTD_c_targetLength, (int)comprParams->targetLength));
|
CHECK_Z(ZSTD_CCtx_setParameter(ctx, ZSTD_c_targetLength, (int)comprParams->targetLength));
|
||||||
CHECK_Z(ZSTD_CCtx_setParameter(ctx, ZSTD_c_literalCompressionMode, (int)adv->literalCompressionMode));
|
CHECK_Z(ZSTD_CCtx_setParameter(ctx, ZSTD_c_literalCompressionMode, (int)adv->literalCompressionMode));
|
||||||
CHECK_Z(ZSTD_CCtx_setParameter(ctx, ZSTD_c_strategy, comprParams->strategy));
|
CHECK_Z(ZSTD_CCtx_setParameter(ctx, ZSTD_c_strategy, (int)comprParams->strategy));
|
||||||
CHECK_Z(ZSTD_CCtx_loadDictionary(ctx, dictBuffer, dictBufferSize));
|
CHECK_Z(ZSTD_CCtx_loadDictionary(ctx, dictBuffer, dictBufferSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -393,8 +393,6 @@ BMK_benchMemAdvancedNoAlloc(
|
||||||
BMK_benchParams_t cbp, dbp;
|
BMK_benchParams_t cbp, dbp;
|
||||||
BMK_initCCtxArgs cctxprep;
|
BMK_initCCtxArgs cctxprep;
|
||||||
BMK_initDCtxArgs dctxprep;
|
BMK_initDCtxArgs dctxprep;
|
||||||
UTIL_HumanReadableSize_t hr_isize;
|
|
||||||
UTIL_HumanReadableSize_t hr_osize;
|
|
||||||
|
|
||||||
cbp.benchFn = local_defaultCompress; /* ZSTD_compress2 */
|
cbp.benchFn = local_defaultCompress; /* ZSTD_compress2 */
|
||||||
cbp.benchPayload = cctx;
|
cbp.benchPayload = cctx;
|
||||||
|
@ -431,10 +429,9 @@ BMK_benchMemAdvancedNoAlloc(
|
||||||
dctxprep.dictBuffer = dictBuffer;
|
dctxprep.dictBuffer = dictBuffer;
|
||||||
dctxprep.dictBufferSize = dictBufferSize;
|
dctxprep.dictBufferSize = dictBufferSize;
|
||||||
|
|
||||||
hr_isize = UTIL_makeHumanReadableSize((U64) srcSize);
|
|
||||||
|
|
||||||
DISPLAYLEVEL(2, "\r%70s\r", ""); /* blank line */
|
DISPLAYLEVEL(2, "\r%70s\r", ""); /* blank line */
|
||||||
DISPLAYLEVEL(2, "%2s-%-17.17s : %.*f%s -> \r", marks[markNb], displayName, hr_isize.precision, hr_isize.value, hr_isize.suffix);
|
assert(srcSize < UINT_MAX);
|
||||||
|
DISPLAYLEVEL(2, "%2s-%-17.17s :%10u -> \r", marks[markNb], displayName, (unsigned)srcSize);
|
||||||
|
|
||||||
while (!(compressionCompleted && decompressionCompleted)) {
|
while (!(compressionCompleted && decompressionCompleted)) {
|
||||||
if (!compressionCompleted) {
|
if (!compressionCompleted) {
|
||||||
|
@ -446,7 +443,7 @@ BMK_benchMemAdvancedNoAlloc(
|
||||||
|
|
||||||
{ BMK_runTime_t const cResult = BMK_extract_runTime(cOutcome);
|
{ BMK_runTime_t const cResult = BMK_extract_runTime(cOutcome);
|
||||||
cSize = cResult.sumOfReturn;
|
cSize = cResult.sumOfReturn;
|
||||||
ratio = (double)srcSize / cSize;
|
ratio = (double)srcSize / (double)cSize;
|
||||||
{ BMK_benchResult_t newResult;
|
{ BMK_benchResult_t newResult;
|
||||||
newResult.cSpeed = (U64)((double)srcSize * TIMELOOP_NANOSEC / cResult.nanoSecPerRun);
|
newResult.cSpeed = (U64)((double)srcSize * TIMELOOP_NANOSEC / cResult.nanoSecPerRun);
|
||||||
benchResult.cSize = cSize;
|
benchResult.cSize = cSize;
|
||||||
|
@ -455,11 +452,10 @@ BMK_benchMemAdvancedNoAlloc(
|
||||||
} }
|
} }
|
||||||
|
|
||||||
{ int const ratioAccuracy = (ratio < 10.) ? 3 : 2;
|
{ int const ratioAccuracy = (ratio < 10.) ? 3 : 2;
|
||||||
hr_osize = UTIL_makeHumanReadableSize((U64) cSize);
|
assert(cSize < UINT_MAX);
|
||||||
DISPLAYLEVEL(2, "%2s-%-17.17s : %.*f%s -> %.*f%s (%5.*f), %6.*f MB/s\r",
|
DISPLAYLEVEL(2, "%2s-%-17.17s :%10u ->%10u (%5.*f), %6.*f MB/s\r",
|
||||||
marks[markNb], displayName,
|
marks[markNb], displayName,
|
||||||
hr_isize.precision, hr_isize.value, hr_isize.suffix,
|
(unsigned)srcSize, (unsigned)cSize,
|
||||||
hr_osize.precision, hr_osize.value, hr_osize.suffix,
|
|
||||||
ratioAccuracy, ratio,
|
ratioAccuracy, ratio,
|
||||||
benchResult.cSpeed < (10 MB) ? 2 : 1, (double)benchResult.cSpeed / MB_UNIT);
|
benchResult.cSpeed < (10 MB) ? 2 : 1, (double)benchResult.cSpeed / MB_UNIT);
|
||||||
}
|
}
|
||||||
|
@ -480,11 +476,9 @@ BMK_benchMemAdvancedNoAlloc(
|
||||||
}
|
}
|
||||||
|
|
||||||
{ int const ratioAccuracy = (ratio < 10.) ? 3 : 2;
|
{ int const ratioAccuracy = (ratio < 10.) ? 3 : 2;
|
||||||
hr_osize = UTIL_makeHumanReadableSize((U64) cSize);
|
DISPLAYLEVEL(2, "%2s-%-17.17s :%10u ->%10u (%5.*f), %6.*f MB/s, %6.1f MB/s \r",
|
||||||
DISPLAYLEVEL(2, "%2s-%-17.17s : %.*f%s -> %.*f%s (%5.*f), %6.*f MB/s, %6.1f MB/s \r",
|
|
||||||
marks[markNb], displayName,
|
marks[markNb], displayName,
|
||||||
hr_isize.precision, hr_isize.value, hr_isize.suffix,
|
(unsigned)srcSize, (unsigned)cSize,
|
||||||
hr_osize.precision, hr_osize.value, hr_osize.suffix,
|
|
||||||
ratioAccuracy, ratio,
|
ratioAccuracy, ratio,
|
||||||
benchResult.cSpeed < (10 MB) ? 2 : 1, (double)benchResult.cSpeed / MB_UNIT,
|
benchResult.cSpeed < (10 MB) ? 2 : 1, (double)benchResult.cSpeed / MB_UNIT,
|
||||||
(double)benchResult.dSpeed / MB_UNIT);
|
(double)benchResult.dSpeed / MB_UNIT);
|
||||||
|
|
|
@ -308,7 +308,8 @@ U64 UTIL_getFileSizeStat(const stat_t* statbuf)
|
||||||
return (U64)statbuf->st_size;
|
return (U64)statbuf->st_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
UTIL_HumanReadableSize_t UTIL_makeHumanReadableSize(U64 size) {
|
UTIL_HumanReadableSize_t UTIL_makeHumanReadableSize(U64 size)
|
||||||
|
{
|
||||||
UTIL_HumanReadableSize_t hrs;
|
UTIL_HumanReadableSize_t hrs;
|
||||||
|
|
||||||
if (g_utilDisplayLevel > 3) {
|
if (g_utilDisplayLevel > 3) {
|
||||||
|
@ -1121,9 +1122,9 @@ DWORD CountSetBits(ULONG_PTR bitMask)
|
||||||
{
|
{
|
||||||
DWORD LSHIFT = sizeof(ULONG_PTR)*8 - 1;
|
DWORD LSHIFT = sizeof(ULONG_PTR)*8 - 1;
|
||||||
DWORD bitSetCount = 0;
|
DWORD bitSetCount = 0;
|
||||||
ULONG_PTR bitTest = (ULONG_PTR)1 << LSHIFT;
|
ULONG_PTR bitTest = (ULONG_PTR)1 << LSHIFT;
|
||||||
DWORD i;
|
DWORD i;
|
||||||
|
|
||||||
for (i = 0; i <= LSHIFT; ++i)
|
for (i = 0; i <= LSHIFT; ++i)
|
||||||
{
|
{
|
||||||
bitSetCount += ((bitMask & bitTest)?1:0);
|
bitSetCount += ((bitMask & bitTest)?1:0);
|
||||||
|
|
|
@ -180,9 +180,13 @@ U64 UTIL_getFileSize(const char* infilename);
|
||||||
U64 UTIL_getTotalFileSize(const char* const * fileNamesTable, unsigned nbFiles);
|
U64 UTIL_getTotalFileSize(const char* const * fileNamesTable, unsigned nbFiles);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Take a size in bytes and prepare the components to pretty-print it in a
|
* Take @size in bytes,
|
||||||
* scaled way. The components in the returned struct should be passed in
|
* prepare the components to pretty-print it in a scaled way.
|
||||||
|
* The components in the returned struct should be passed in
|
||||||
* precision, value, suffix order to a "%.*f%s" format string.
|
* precision, value, suffix order to a "%.*f%s" format string.
|
||||||
|
* Output policy is sensible to @g_utilDisplayLevel,
|
||||||
|
* for verbose mode (@g_utilDisplayLevel >= 4),
|
||||||
|
* does not scale down.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
double value;
|
double value;
|
||||||
|
|
Loading…
Reference in New Issue