On 10/23/06, Tom Lane < [EMAIL PROTECTED] > wrote:
I didn't particularly trust the timing calculations in your benchmark
Any particular reason? (why and what did you doubt in it?).
I designed the prog. to be flexible to test different sized blocks (to cost single/less INIT/COMP/FIN iterations), and different size lists of data (to control the number of iterations). Please share you wisdom.
When I first saw your results, I had a strong feeling that function-call overhead was going against SB8. And then, Jeremy's trials, and subsequent success, on disabling loop optimizations also pointed to this possibility.
So, I have taken your tests and converted the SB8 function calls into macros. And the results are (please note that crc = 0 is explained later):
crc = 0, bufsize = 8192, loops = 1000000, elapsed = 8.471994
crc = 0, bufsize = 8192, loops = 1000000, elapsed = 0.000006
crc = 8228BB0E, bufsize = 8192, loops = 1000000, elapsed = 32.490704
crc = 7E67A22A, bufsize = 8192, loops = 1000000, elapsed = 22.349156
crc = 0, bufsize = 64, loops = 1000000, elapsed = 0.151354
crc = 0, bufsize = 64, loops = 1000000, elapsed = 0.000005
crc = 9C9FBE2E, bufsize = 64, loops = 1000000, elapsed = 0.559315
crc = F70BC6AE, bufsize = 64, loops = 1000000, elapsed = 0.357382
The result names are in the format: <algo_type>_<test_size>_<was_mycrc_referenced_in_printf>.out
crc = 0 in the result means that the mycrc variable was not refereced anywhere after the for-loop. As can be seen, if mycrc is not refrenced in the printf, that is, it's usage is limited to just inside the 'for' loop, then GCC ( 4.1) seems to be optimizing the loop heavily. In the case of SB8, if mycrc is not referenced later, it seems to have totally removed the loop!!!
The only difference between the <x>_noprintcrc and the <x>_printcrc tests was that in the printf() call, the first parameter after the format string was either a zero or mycrc variable, respectively.
I am highly apprehensive that I might have made some mistake while converting function calls to macros; though, I have not besen able to prove it thus far. Please check it's validity as compared to the function-call version.
If there's no mistake, then I think SB8 is back in the performance game now. These results were obtained with gcc 4.1 on FC5 running on Intel Pentium M 1.86 GHz, and OS starteted and running in runlevel 3.
Please dump the .c and .h files from the attachment on top of Tom's package, and test it as earlier.
[EMAIL PROTECTED] gmail | hotmail | yahoo }.com
Description: GNU Zip compressed data
---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly