changed default compression level to 3 (can be modified with macro ZSTDCLI_DEFAULT_CLEVEL)

dev
Yann Collet 2016-07-13 14:15:08 +02:00
parent fbc69f8649
commit 2cac5b30b9
3 changed files with 18 additions and 6 deletions

3
.gitignore vendored
View File

@ -37,3 +37,6 @@ _zstdbench/
# CMake
projects/cmake/
# Test artefacts
tmp*

View File

@ -330,7 +330,6 @@ static int FIO_compressFilename_internal(cRess_t ress,
} }
/* Main compression loop */
readsize = 0;
while (1) {
/* Fill input Buffer */
size_t const inSize = fread(ress.srcBuffer, (size_t)1, ress.srcBufferSize, srcFile);
@ -338,8 +337,8 @@ static int FIO_compressFilename_internal(cRess_t ress,
readsize += inSize;
DISPLAYUPDATE(2, "\rRead : %u MB ", (U32)(readsize>>20));
{ /* Compress using buffered streaming */
size_t usedInSize = inSize;
/* Compress using buffered streaming */
{ size_t usedInSize = inSize;
size_t cSize = ress.dstBufferSize;
{ size_t const result = ZBUFF_compressContinue(ress.ctx, ress.dstBuffer, &cSize, ress.srcBuffer, &usedInSize);
if (ZBUFF_isError(result)) EXM_THROW(23, "Compression error : %s ", ZBUFF_getErrorName(result)); }
@ -366,8 +365,10 @@ static int FIO_compressFilename_internal(cRess_t ress,
}
/* Status */
{ size_t const len = strlen(srcFileName);
if (len > 20) srcFileName += len-20; }
DISPLAYLEVEL(2, "\r%79s\r", "");
DISPLAYLEVEL(2,"%-20.20s :%6.2f%% (%6llu =>%6llu bytes, %s) \n", srcFileName,
DISPLAYLEVEL(2,"%-20.20s :%6.2f%% (%6llu => %6llu bytes, %s) \n", srcFileName,
(double)compressedfilesize/readsize*100, (unsigned long long)readsize, (unsigned long long) compressedfilesize,
dstFileName);

View File

@ -28,6 +28,14 @@
*/
/*-************************************
* Tuning parameters
**************************************/
#ifndef ZSTDCLI_DEFAULT_CLEVEL
# define ZSTDCLI_DEFAULT_CLEVEL 3
#endif
/*-************************************
* Includes
**************************************/
@ -207,7 +215,7 @@ int main(int argCount, const char** argv)
nextArgumentIsMaxDict=0,
nextArgumentIsDictID=0,
nextArgumentIsFile=0;
unsigned cLevel = 1;
unsigned cLevel = ZSTDCLI_DEFAULT_CLEVEL;
unsigned cLevelLast = 1;
unsigned recursive = 0;
const char** filenameTable = (const char**)malloc(argCount * sizeof(const char*)); /* argCount >= 1 */
@ -331,7 +339,7 @@ int main(int argCount, const char** argv)
/* test compressed file */
case 't': decode=1; outFileName=nulmark; argument++; break;
/* dictionary name */
/* destination file name */
case 'o': nextArgumentIsOutFileName=1; argument++; break;
/* recursive */