From 93f371a3809b11713e0230705637e7f148904505 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 30 May 2010 05:46:55 +0000 Subject: *** empty log message *** --- bench.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'bench.c') diff --git a/bench.c b/bench.c index c919eb6..b108503 100644 --- a/bench.c +++ b/bench.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -70,7 +71,7 @@ int main(void) 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 @@ int main(void) //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) -- cgit v1.2.3