ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/liblzf/bench.c
(Generate patch)

Comparing liblzf/bench.c (file contents):
Revision 1.3 by root, Tue Mar 8 19:59:52 2005 UTC vs.
Revision 1.4 by root, Tue Nov 13 10:48:02 2007 UTC

1#include <stdio.h> 1#include <stdio.h>
2#include <assert.h> 2#include <assert.h>
3#include <string.h> 3#include <string.h>
4 4
5#include "lzf.h" 5#include "lzf.h"
6//#include "fastlz.c"
6 7
7typedef unsigned long tval; 8typedef unsigned long tval;
8typedef unsigned long long stamp64; 9typedef unsigned long long stamp64;
9 10
10extern inline tval stamp(void) 11extern inline tval stamp(void)
22 return tsc-t; 23 return tsc-t;
23 else 24 else
24 return t-tsc; 25 return t-tsc;
25} 26}
26 27
27#define DSIZE 1000000 28#define DSIZE 2821120
28 29
29unsigned char data[DSIZE], data2[DSIZE*2], data3[DSIZE*2]; 30unsigned char data[DSIZE], data2[DSIZE*2], data3[DSIZE*2];
30 31
31int main(void) 32int main(void)
32{ 33{
41 fclose (f); 42 fclose (f);
42 43
43 for (lp = 0; lp < 1000; lp++) { 44 for (lp = 0; lp < 1000; lp++) {
44 s=stamp(); 45 s=stamp();
45 l = lzf_compress (data, DSIZE, data2, DSIZE*2); 46 l = lzf_compress (data, DSIZE, data2, DSIZE*2);
47 //l = fastlz_compress_level (1, data, DSIZE, data2);
48 si[0]=measure(s);
46 j = lzf_decompress (data2, l, data3, DSIZE*2); 49 j = lzf_decompress (data2, l, data3, DSIZE*2);
47 si[0]=measure(s);
48 50
49 printf ("\r%10d (%d) ", si[0], l); 51 printf ("\r%10d (%d) ", si[0], l);
50 if (si[0] < min && si[0] > 0) 52 if (si[0] < min && si[0] > 0)
51 { 53 {
52 printf ("\n"); 54 printf ("\n");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines