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

Comparing liblzf/bench.c (file contents):
Revision 1.8 by root, Tue May 6 22:49:18 2008 UTC vs.
Revision 1.9 by root, Thu Dec 18 16:05:14 2008 UTC

4#include <time.h> 4#include <time.h>
5#include <sys/time.h> 5#include <sys/time.h>
6#include <sys/types.h> 6#include <sys/types.h>
7#include <sys/socket.h> 7#include <sys/socket.h>
8#include <sys/ioctl.h> 8#include <sys/ioctl.h>
9#include <sys/stat.h>
9#include <math.h> 10#include <math.h>
10#include <signal.h> 11#include <signal.h>
11#include <X11/Xlib.h> 12#include <X11/Xlib.h>
12 13
13#include "lzf.h" 14#include "lzf.h"
52 int lp; 53 int lp;
53 char buf[8192]; 54 char buf[8192];
54 int p[2]; 55 int p[2];
55 int evfd = eventfd (0, 0); 56 int evfd = eventfd (0, 0);
56 long ctr = 1; 57 long ctr = 1;
58 struct stat sbuf;
57 59
58 pipe (p); 60 pipe (p);
59 61
60 FILE *f = fopen ("data", "r"); 62 FILE *f = fopen ("data", "r");
61 fread (data, DSIZE, 1, f); 63 fread (data, DSIZE, 1, f);
64 signal (SIGURG, sigu); 66 signal (SIGURG, sigu);
65 67
66 for (lp = 0; lp < 100000; lp++) { 68 for (lp = 0; lp < 100000; lp++) {
67 s=stamp(); 69 s=stamp();
68 70
69 snprintf (buf, 64, "<1.%llx>", (unsigned long long)0xa234567812ULL); 71 //snprintf (buf, 64, "<1.%llx>", (unsigned long long)0xa234567812ULL);
72 //getpgrp();
70 //kill (0, SIGURG); 73 //kill (0, SIGURG);
71 //write (evfd, &ctr, 8); 74 //write (evfd, &ctr, 8);
72 //read (evfd, &ctr, 8); 75 //read (evfd, &ctr, 8);
73// write (p[1], &buf, 1); 76 //write (p[1], &buf, 1);
74// read (p[0], &buf, 4); 77 //read (p[0], &buf, 4);
78 //stat ("/etc/passwd", &sbuf);
79 free(malloc(8*1024*1024));
75 80
76 si[0]=measure(s); 81 si[0]=measure(s);
77 82
78 //j = lzf_decompress (data2, l, data3, DSIZE*2); 83 //j = lzf_decompress (data2, l, data3, DSIZE*2);
79 84

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines