From e8a6067e8a2d033049e5eafa0617c29b0e51146f Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Fri, 4 Nov 2016 14:46:45 +0100 Subject: updated lz4cli.c --- programs/Makefile | 6 +++--- programs/bench.c | 5 +++-- programs/lz4cli.c | 13 ++++++------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/programs/Makefile b/programs/Makefile index 531533c..39672b3 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -58,13 +58,13 @@ bins: lz4 lz4c all: bins m32 -lz4: $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/lz4frame.o $(LZ4DIR)/xxhash.o bench.o lz4io.o lz4cli.o +lz4: $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/lz4frame.o $(LZ4DIR)/xxhash.o bench.o lz4io.o lz4cli.o datagen.o $(CC) $(FLAGS) $^ -o $@$(EXT) -lz4c : $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/lz4frame.o $(LZ4DIR)/xxhash.o bench.o lz4io.o lz4cli.o +lz4c : $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/lz4frame.o $(LZ4DIR)/xxhash.o bench.o lz4io.o lz4cli.o datagen.o $(CC) $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT) -lz4c32: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c bench.c lz4io.c lz4cli.c +lz4c32: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c bench.c lz4io.c lz4cli.c datagen.c $(CC) -m32 $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT) clean: diff --git a/programs/bench.c b/programs/bench.c index 1840bb0..51c07f5 100644 --- a/programs/bench.c +++ b/programs/bench.c @@ -59,6 +59,7 @@ static int LZ4_compress_local(const char* src, char* dst, int srcSize, int dstSi #define TIMELOOP_MICROSEC 1*1000000ULL /* 1 second */ #define ACTIVEPERIOD_MICROSEC 70*1000000ULL /* 70 seconds */ #define COOLPERIOD_SEC 10 +#define DECOMP_MULT 2 /* test decompression DECOMP_MULT times longer than compression */ #define KB *(1 <<10) #define MB *(1 <<20) @@ -291,11 +292,11 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize, blockTable[blockNb].resSize = regenSize; } nbLoops++; - } while (UTIL_clockSpanMicro(clockStart, ticksPerSecond) < clockLoop); + } while (UTIL_clockSpanMicro(clockStart, ticksPerSecond) < DECOMP_MULT*clockLoop); { U64 const clockSpan = UTIL_clockSpanMicro(clockStart, ticksPerSecond); if (clockSpan < fastestD*nbLoops) fastestD = clockSpan / nbLoops; totalDTime += clockSpan; - dCompleted = totalDTime>maxTime; + dCompleted = totalDTime>(DECOMP_MULT*maxTime); } } markNb = (markNb+1) % NB_MARKS; diff --git a/programs/lz4cli.c b/programs/lz4cli.c index 74c9856..b707795 100644 --- a/programs/lz4cli.c +++ b/programs/lz4cli.c @@ -176,10 +176,9 @@ static int usage_advanced(void) DISPLAY( "--content-size : compressed frame includes original size (default:not present)\n"); DISPLAY( "--[no-]sparse : sparse mode (default:enabled on file, disabled on stdout)\n"); DISPLAY( "Benchmark arguments :\n"); - DISPLAY( "Benchmark arguments :\n"); DISPLAY( " -b# : benchmark file(s), using # compression level (default : 1) \n"); - DISPLAY( " -e# : test all compression levels from -bX to # (default: 1)\n"); - DISPLAY( " -i# : iteration loops [1-9](default : 3), benchmark mode only\n"); + DISPLAY( " -e# : test all compression levels from -bX to # (default : 1)\n"); + DISPLAY( " -i# : minimum evaluation time in seconds (default : 3s)\n"); #if defined(ENABLE_LZ4C_LEGACY_OPTIONS) DISPLAY( "Legacy arguments :\n"); DISPLAY( " -c0 : fast compression\n"); @@ -421,7 +420,7 @@ int main(int argc, const char** argv) case '7': { int B = argument[1] - '0'; blockSize = LZ4IO_setBlockSizeID(B); - BMK_setBlocksize(blockSize); + BMK_SetBlockSize(blockSize); argument++; break; } @@ -449,18 +448,18 @@ int main(int argc, const char** argv) inFileNames = (const char**) malloc(argc * sizeof(char*)); break; - /* Modify Nb Iterations (benchmark only) */ + /* Modify Nb Seconds (benchmark only) */ case 'i': { unsigned iters; argument++; iters = readU32FromChar(&argument); argument--; - BMK_setNbIterations(iters); + BMK_SetNbSeconds(iters); } break; /* Pause at the end (hidden option) */ - case 'p': main_pause=1; BMK_setPause(); break; + case 'p': main_pause=1; break; /* Specific commands for customized versions */ EXTENDED_ARGUMENTS; -- cgit v0.12