summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2007-11-13 10:48:02 +0000
committerroot <root>2007-11-13 10:48:02 +0000
commitd29dfa6df56424f073e0de300f6b2e40f5ace61a (patch)
tree88f31a9984f1c728adbf810764566e0e7f3f8000
parent84e5a8dc51fb7e6e9e6044d9fd100cb91c451c9a (diff)
*** empty log message ***
-rw-r--r--Changes5
-rw-r--r--bench.c6
-rw-r--r--lzf_c.c5
3 files changed, 9 insertions, 7 deletions
diff --git a/Changes b/Changes
index 07c835e..7e6b7e6 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,4 @@
+2.2
- switched to GPL v2 or any later version.
- speed up compression by ~10-15% in common cases
by some manual unrolling.
@@ -6,8 +7,8 @@
- for typical binary data (e.g. /bin/bash, memory dumps,
canterbury corpus etc.), speed is now comparable to fastlz, but
with better compression ratio. with ULTRA_FAST, it's typically
- 3-8% faster than fastlz while still maintaining a similar ratio.
- (amd64, ymmv). thanks a lot for the competition :)
+ 3-15% faster than fastlz while still maintaining a similar ratio.
+ (amd64 and core 2 duo, ymmv). thanks a lot for the competition :)
- undo inline assembly, it is no longer helpful.
2.1 Fri Nov 2 13:34:42 CET 2007
diff --git a/bench.c b/bench.c
index 9e0f3c3..4289b8e 100644
--- a/bench.c
+++ b/bench.c
@@ -3,6 +3,7 @@
#include <string.h>
#include "lzf.h"
+//#include "fastlz.c"
typedef unsigned long tval;
typedef unsigned long long stamp64;
@@ -24,7 +25,7 @@ extern inline tval measure(tval t)
return t-tsc;
}
-#define DSIZE 1000000
+#define DSIZE 2821120
unsigned char data[DSIZE], data2[DSIZE*2], data3[DSIZE*2];
@@ -43,8 +44,9 @@ int main(void)
for (lp = 0; lp < 1000; lp++) {
s=stamp();
l = lzf_compress (data, DSIZE, data2, DSIZE*2);
- j = lzf_decompress (data2, l, data3, DSIZE*2);
+ //l = fastlz_compress_level (1, data, DSIZE, data2);
si[0]=measure(s);
+ j = lzf_decompress (data2, l, data3, DSIZE*2);
printf ("\r%10d (%d) ", si[0], l);
if (si[0] < min && si[0] > 0)
diff --git a/lzf_c.c b/lzf_c.c
index 95a245d..98371c5 100644
--- a/lzf_c.c
+++ b/lzf_c.c
@@ -48,13 +48,12 @@
# define FRST(p) (((p[0]) << 8) | p[1])
# define NEXT(v,p) (((v) << 8) | p[2])
# if ULTRA_FAST
-# define IDX(h) (((h >> (3*8 - HLOG)) - h ) & (HSIZE - 1))
+# define IDX(h) ((( h >> (3*8 - HLOG)) - h ) & (HSIZE - 1))
# elif VERY_FAST
-# define IDX(h) (((h >> (3*8 - HLOG)) - h*5) & (HSIZE - 1))
+# define IDX(h) ((( h >> (3*8 - HLOG)) - h*5) & (HSIZE - 1))
# else
# define IDX(h) ((((h ^ (h << 5)) >> (3*8 - HLOG)) - h*5) & (HSIZE - 1))
# endif
-/*# define IDX(h) ((ip[0] * 121 ^ ip[1] * 33 ^ ip[2] * 1) & (HSIZE-1))*/
#endif
/*
* IDX works because it is very similar to a multiplicative hash, e.g.