summaryrefslogtreecommitdiffstats
path: root/programs/bench.c
diff options
context:
space:
mode:
authoryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2014-02-04 14:11:10 (GMT)
committeryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2014-02-04 14:11:10 (GMT)
commit69dc85b8abe78246bea91a5ba1205e4c07b96a97 (patch)
tree0ed0250f8284861b90c2781aaa76172ebf97b6fd /programs/bench.c
parent96a60a52eb3e7d7a4785ad1dfc4e0abe3d0e10a1 (diff)
downloadlz4-69dc85b8abe78246bea91a5ba1205e4c07b96a97.zip
lz4-69dc85b8abe78246bea91a5ba1205e4c07b96a97.tar.gz
lz4-69dc85b8abe78246bea91a5ba1205e4c07b96a97.tar.bz2
Large decompression speed improvement for GCC 32-bits. Thanks to Valery Croizier !
LZ4HC : Compression Level is now a programmable parameter (CLI from 4 to 9) Separated IO routines from command line (lz4io.c) Version number into lz4.h (suggested by Francesc Alted) git-svn-id: https://lz4.googlecode.com/svn/trunk@113 650e7d94-2a16-8b24-b05c-7c0b3f6821cd
Diffstat (limited to 'programs/bench.c')
-rw-r--r--programs/bench.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/programs/bench.c b/programs/bench.c
index df3c44a..ea6a1ca 100644
--- a/programs/bench.c
+++ b/programs/bench.c
@@ -59,9 +59,10 @@
#endif
#include "lz4.h"
-#define COMPRESSOR0 LZ4_compress
+#define COMPRESSOR0 LZ4_compress_local
+static int LZ4_compress_local(const char* src, char* dst, int size, int clevel) { (void)clevel; return LZ4_compress(src, dst, size); }
#include "lz4hc.h"
-#define COMPRESSOR1 LZ4_compressHC
+#define COMPRESSOR1 LZ4_compressHC2
#define DEFAULTCOMPRESSOR COMPRESSOR0
#include "xxhash.h"
@@ -128,7 +129,7 @@ struct chunkParameters
struct compressionParameters
{
- int (*compressionFunction)(const char*, char*, int);
+ int (*compressionFunction)(const char*, char*, int, int);
int (*decompressionFunction)(const char*, char*, int);
};
@@ -139,7 +140,6 @@ struct compressionParameters
#define DISPLAY(...) fprintf(stderr, __VA_ARGS__)
-
//**************************************
// Benchmark Parameters
//**************************************
@@ -254,7 +254,7 @@ int BMK_benchFile(char** fileNamesTable, int nbFiles, int cLevel)
// Init
- if (cLevel <3) cfunctionId = 0; else cfunctionId = 1;
+ if (cLevel <= 3) cfunctionId = 0; else cfunctionId = 1;
switch (cfunctionId)
{
#ifdef COMPRESSOR0
@@ -377,7 +377,7 @@ int BMK_benchFile(char** fileNamesTable, int nbFiles, int cLevel)
while(BMK_GetMilliSpan(milliTime) < TIMELOOP)
{
for (chunkNb=0; chunkNb<nbChunks; chunkNb++)
- chunkP[chunkNb].compressedSize = compP.compressionFunction(chunkP[chunkNb].origBuffer, chunkP[chunkNb].compressedBuffer, chunkP[chunkNb].origSize);
+ chunkP[chunkNb].compressedSize = compP.compressionFunction(chunkP[chunkNb].origBuffer, chunkP[chunkNb].compressedBuffer, chunkP[chunkNb].origSize, cLevel);
nbLoops++;
}
milliTime = BMK_GetMilliSpan(milliTime);