Bruce Guenter <[EMAIL PROTECTED]> writes:
>> I agree, don't send it to the whole list. But I'd like a copy.
> Here you go.
As near as I could tell, the test as you have it (one CRC computation per
fread) is purely I/O bound. I changed the main loop to this:
int main() {
static char buf[8192];
size_t rd;
hash_t hash;
while (rd = fread(buf, 1, sizeof buf, stdin)) {
int i;
for (i = 0; i < 1000; i++) {
init(&hash);
update(&hash, buf, rd);
}
}
return 0;
}
so as to get a reasonable amount of computation per fread. On an
otherwise idle HP 9000 C180 machine, I get the following numbers on a
1MB input file:
time benchcrc <random32
real 35.3
user 35.0
sys 0.0
time benchmd5 <random32
real 37.6
user 37.3
sys 0.0
This is a lot closer than I'd have expected, but it sure ain't
"MD5 40% faster" as you reported. I wonder why the difference
in results between your platform and mine?
BTW, I used gcc 2.95.2 to compile, -O6, no other switches.
regards, tom lane