Merge pull request #1079 from facebook/ovlog

restore ability to set overlapLog
This commit is contained in:
Yann Collet 2018-03-30 15:52:07 -06:00 committed by GitHub
commit 678d0cacbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 0 deletions

View File

@ -466,6 +466,13 @@ static cRess_t FIO_createCResources(const char* dictFileName, int cLevel,
#ifdef ZSTD_MULTITHREAD #ifdef ZSTD_MULTITHREAD
DISPLAYLEVEL(5,"set nb workers = %u \n", g_nbWorkers); DISPLAYLEVEL(5,"set nb workers = %u \n", g_nbWorkers);
CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_nbWorkers, g_nbWorkers) ); CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_nbWorkers, g_nbWorkers) );
if ( (g_overlapLog == FIO_OVERLAP_LOG_NOTSET)
&& (cLevel == ZSTD_maxCLevel()) )
g_overlapLog = 9; /* full overlap */
if (g_overlapLog != FIO_OVERLAP_LOG_NOTSET) {
DISPLAYLEVEL(3,"set overlapLog = %u \n", g_overlapLog);
CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_overlapSizeLog, g_overlapLog) );
}
#endif #endif
/* dictionary */ /* dictionary */
CHECK( ZSTD_CCtx_setPledgedSrcSize(ress.cctx, srcSize) ); /* set the value temporarily for dictionary loading, to adapt compression parameters */ CHECK( ZSTD_CCtx_setPledgedSrcSize(ress.cctx, srcSize) ); /* set the value temporarily for dictionary loading, to adapt compression parameters */

View File

@ -650,6 +650,25 @@ then
$ECHO "\n===> zstdmt long distance matching round-trip tests " $ECHO "\n===> zstdmt long distance matching round-trip tests "
roundTripTest -g8M "3 --long=24 -T2" roundTripTest -g8M "3 --long=24 -T2"
$ECHO "\n===> ovLog tests "
./datagen -g2MB > tmp
refSize=$($ZSTD tmp -6 -c --zstd=wlog=18 | wc -c)
ov9Size=$($ZSTD tmp -6 -c --zstd=wlog=18,ovlog=9 | wc -c)
ov0Size=$($ZSTD tmp -6 -c --zstd=wlog=18,ovlog=0 | wc -c)
if [ $refSize -eq $ov9Size ]; then
echo ov9Size should be different from refSize
exit 1
fi
if [ $refSize -eq $ov0Size ]; then
echo ov0Size should be different from refSize
exit 1
fi
if [ $ov9Size -ge $ov0Size ]; then
echo ov9Size=$ov9Size should be smaller than ov0Size=$ov0Size
exit 1
fi
else else
$ECHO "\n===> no multithreading, skipping zstdmt tests " $ECHO "\n===> no multithreading, skipping zstdmt tests "
fi fi