minor tuning

This commit is contained in:
Yann Collet 2015-10-28 19:07:05 +01:00
parent 81e49e6654
commit 76c5c2a4a0
2 changed files with 32 additions and 32 deletions

View File

@ -55,7 +55,7 @@ typedef struct
/* parameters boundaries */
#define ZSTD_HC_WINDOWLOG_MAX 26
#define ZSTD_HC_WINDOWLOG_MIN 17
#define ZSTD_HC_WINDOWLOG_MIN 18
#define ZSTD_HC_CHAINLOG_MAX ZSTD_HC_WINDOWLOG_MAX
#define ZSTD_HC_CHAINLOG_MIN 4
#define ZSTD_HC_HASHLOG_MAX 28
@ -81,35 +81,37 @@ size_t ZSTD_HC_compress_advanced (ZSTD_HC_CCtx* ctx,
#define ZSTD_HC_MAX_CLEVEL 25
static const ZSTD_HC_parameters ZSTD_HC_defaultParameters[ZSTD_HC_MAX_CLEVEL+1] = {
/* W, C, H, S */
{ 18, 4, 12, 1 }, /* 0 - should never be used */
{ 18, 11, 14, 1 }, /* 1 */
{ 20, 13, 16, 2 }, /* 2 */
{ 20, 19, 20, 2 }, /* 3 */
{ 21, 19, 20, 4 }, /* 4 */
{ 21, 20, 21, 4 }, /* 5 */
{ 21, 20, 22, 5 }, /* 6 */
{ 21, 20, 22, 6 }, /* 7 */
{ 21, 20, 22, 7 }, /* 8 */
{ 21, 21, 23, 7 }, /* 9 */
{ 21, 21, 23, 8 }, /*10 */
{ 21, 21, 23, 9 }, /*11 */
{ 21, 21, 23, 10 }, /*12 */
{ 22, 22, 23, 9 }, /*13 */
{ 22, 22, 23, 10 }, /*14 */
{ 23, 23, 23, 10 }, /*15 */
{ 24, 23, 23, 11 }, /*16 */
{ 24, 24, 23, 11 }, /*17 */
{ 24, 24, 23, 12 }, /*18 */
{ 24, 24, 23, 13 }, /*19 */
{ 24, 24, 23, 13 }, /*20 */
{ 24, 24, 23, 13 }, /*21 */
{ 24, 24, 23, 13 }, /*22 */
{ 24, 24, 23, 13 }, /*23 */
{ 24, 24, 23, 13 }, /*24 */
{ 24, 24, 23, 13 }, /*25 */
{ 18, 12, 14, 1 }, /* level 0 - never used */
{ 18, 12, 15, 2 }, /* level 1 */
{ 19, 14, 16, 3 }, /* level 2 */
{ 20, 19, 19, 2 }, /* level 3 */
{ 20, 19, 19, 3 }, /* level 4 */
{ 20, 19, 19, 4 }, /* level 5 */
{ 20, 20, 19, 4 }, /* level 6 */
{ 20, 19, 19, 5 }, /* level 7 */
{ 20, 19, 19, 6 }, /* level 8 */
{ 20, 20, 20, 6 }, /* level 9 */
{ 21, 20, 21, 6 }, /* level 10 */
{ 21, 20, 21, 7 }, /* level 11 */
{ 21, 20, 22, 7 }, /* level 12 */
{ 21, 21, 23, 7 }, /* level 13 */
{ 21, 21, 23, 7 }, /* level 14 */
{ 21, 21, 23, 8 }, /* level 15 */
{ 21, 21, 23, 9 }, /* level 16 */
{ 21, 21, 23, 9 }, /* level 17 */
{ 21, 21, 23, 10 }, /* level 18 */
{ 22, 22, 23, 9 }, /* level 19 */
{ 22, 22, 23, 9 }, /* level 20 */
{ 22, 22, 23, 10 }, /* level 21 */
{ 22, 22, 23, 10 }, /* level 22 */
{ 22, 22, 23, 11 }, /* level 23 */
{ 22, 22, 23, 12 }, /* level 24 */
{ 23, 23, 23, 11 }, /* level 25 */
};
#if defined (__cplusplus)
}
#endif

View File

@ -497,8 +497,8 @@ static int BMK_seed(winnerInfo_t* winners, const ZSTD_HC_parameters params,
double O_ratioNote = log (O_ratio);
size_t W_DMemUsed = (1 << params.windowLog) + (16 KB);
size_t O_DMemUsed = (1 << winners[cLevel].params.windowLog) + (16 KB);
double W_DMemUsed_note = W_ratioNote * ( 25 + 8*cLevel) - log((double)W_DMemUsed);
double O_DMemUsed_note = O_ratioNote * ( 25 + 8*cLevel) - log((double)O_DMemUsed);
double W_DMemUsed_note = W_ratioNote * ( 40 + 9*cLevel) - log((double)W_DMemUsed);
double O_DMemUsed_note = O_ratioNote * ( 40 + 9*cLevel) - log((double)O_DMemUsed);
size_t W_CMemUsed = (1 << params.windowLog) + 4 * (1 << params.hashLog) + 4 * (1 << params.chainLog);
size_t O_CMemUsed = (1 << winners[cLevel].params.windowLog) + 4 * (1 << winners[cLevel].params.hashLog) + 4 * (1 << winners[cLevel].params.chainLog);
@ -709,9 +709,7 @@ static void BMK_benchMem(void* srcBuffer, size_t srcSize)
/* populate initial solution */
{
const int maxSeeds = g_noSeed ? 1 : 13;
//const int maxSeeds = g_noSeed ? 1 : ZSTD_HC_MAX_CLEVEL;
//BMK_seed(winners, params, srcBuffer, srcSize, ctx);
const int maxSeeds = g_noSeed ? 1 : ZSTD_HC_MAX_CLEVEL;
for (i=1; i<=maxSeeds; i++)
{
params = seedParams[i];