diff options
| -rw-r--r-- | Changes | 5 | ||||
| -rw-r--r-- | bench.c | 6 | ||||
| -rw-r--r-- | lzf_c.c | 5 | 
3 files changed, 9 insertions, 7 deletions
| @@ -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 @@ -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) @@ -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. | 
