* Simon Plouffe <simon.plouffe@gmail.com> [Jul 20. 2007 17:47]:
hello, about that test again (maple VS ENIAC).
I compiled that simple loop in C++ and ran the program on the same machine.
Result : 7 million additions per second.
There should be about one addition per cycle: /* --------------------------- */ /* gcc -W -Wall -O2 add.c -o add time ./add ./add 2.55s user 0.00s system 99% cpu 2.552 total 1000000000/2.55 == 392,156,862 iterations/sec one iteration is 2 float adds, one int add (and the branch) ==> about 2 cycles per float add */ int main() { double i, s; unsigned long k; i = 0.0; s = 0.0; for (k=0; k<1000000000; ++k) { i+=1.0; s+=i; } if ( s < 239 ) return 1; // avoid loop optimized away return 0; } /* --------------------------- */ Only the branch slows things down. Somewhat optimized (unrolled) codes should give rather 2 adds per cycle. With inversion or mod the timing is dominated by those. If one neeeds breakpoints, then use code like /* want N adds, printout at every K-th step */ i=0; loop N/K times: { loop K times: { s += i; i += 1; } print s } This avoids the modulo computation and the additional branch.