centrino 1.7
0.89
0.86
0.859
centrino 1.7
0.89
0.86
0.859
Dual xeon p4 3.2ghz
int. .64
float. .594
double .578
One more for the stack
Time for int test: 0.828000
Time for float test: 0.796000
Time for double test: 0.782000
PC=Intel 2.4g 512mb RAM
Thanks, Mike
Expensive tools can be cheaper than professional therapy
The test seems to be a little too simple to have useful results.
Add in a do nothing test where the destination is just set to the Count. You will find that the time for that test is about the same as for the others. Most of the time is taken by the loop overhead, etc. Depending on the cache performance, it might take longer to store the results than it does to compute them.
There are a lot of existing benchmarks out there (although I don't know of one offhand) that should do a better job telling the whole story.
Ken
Kenneth Lerman
55 Main Street
Newtown, CT 06470
Results with original code: (TEST 1)
Death Adder's Speed Test.
Please don't touch anything or do anything with the machine until this is done!
Time for int test: 1.822000
Time for float test: 2.023000
Time for double test: 2.043000
Results with mathmatic statements commented out, but printf statements left in place: (TEST 2)
Death Adder's Speed Test.
Please don't touch anything or do anything with the machine until this is done!
Time for int test: 1.722000
Time for float test: 1.732000
Time for double test: 1.723000
Results when printf's are taken out of the wrong spot, and put somewhere where they are useful, also integrated the use of the computing variable each time, making it impossible for the compiler to optimize it out: (TEST 3)
Death Adder's Speed Test.
Please don't touch anything or do anything with the machine until this is done!
Time for int test: 0.080000
Time for float test: 0.250000
Time for double test: 0.240000
no optimization flags where used when compiling. As you can tell, the benchmark you all ran was basically showing you how fast printf() can parse a blank string, and realize the variable it got was bogus. If you add up the numbers from TEST 2 and TEST 3, you get TEST1, which is both. TEST2 shows how much power printf takes by itself, and TEST3 shows the real results of mathematic processing of the CPU.
Unfortunalty, the results are useless. No offense to the original programmer, not trying to be mean or anything, but when I saw it, i had to test it as it didn't make much sense to me.
Ross
Processors Information
------------------------------------------------------------------------------------
Processor 1 (ID = 0)
Number of cores 1
Number of threads 1 (max 1)
Name Intel Celeron 330
Codename Prescott
Specification Intel(R) Celeron(R) CPU 2.66GHz
Package Socket 775 LGA (platform ID = 4h)
CPUID F.4.1
Extended CPUID F.4
Core Stepping E0
Technology 90 nm
Core Speed 3065.9 MHz (20.0 x 153.3 MHz)
Rated Bus speed 613.2 MHz
Stock frequency 2666 MHz
Instructions sets MMX, SSE, SSE2, SSE3
L1 Data cache 16 KBytes, 8-way set associative, 64-byte line size
Trace cache 12 Kuops, 8-way set associative
L2 cache 256 KBytes, 4-way set associative, 64-byte line size
FID/VID Control no
***********End CPU-Z INFO***********
Output:
.671
.610
.656