--- liblzf/bench.c 2009/07/18 05:59:21 1.11 +++ liblzf/bench.c 2010/05/30 05:46:56 1.12 @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -70,7 +71,7 @@ for (lp = 0; lp < 1000000; lp++) { s=stamp(); - struct timespec ts; clock_gettime (CLOCK_THREAD_CPUTIME_ID, &ts); + //struct timespec ts; clock_gettime (CLOCK_THREAD_CPUTIME_ID, &ts); //printf ("%9ld\n", ts.tv_nsec);//D //struct rusage usage; getrusage (RUSAGE_SELF, &usage); //struct tms tms; times (&tms); @@ -82,14 +83,17 @@ //read (p[0], &buf, 4); //stat ("/etc/passwd", &sbuf); //struct timeval tv; gettimeofday (&tv, 0); + //void *x = mmap (0, 16384, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE,-1,0); - //l = lzf_compress (data, DSIZE, data2, DSIZE*2); - //assert(l); + l = lzf_compress (data, DSIZE, data2, DSIZE*2); + assert(l); + + j = lzf_decompress (data2, l, data3, DSIZE*2); + assert (j == DSIZE); si[0]=measure(s); - //j = lzf_decompress (data2, l, data3, DSIZE*2); - //assert (j == DSIZE); + assert (!memcmp (data, data3, DSIZE)); printf ("\r%10d (%d) ", si[0], l); if (si[0] < min && si[0] > 0)