in reply to Benchmarking for loops?
I added a 2nd "timethese" to your code, with the tests reversed:
Benchmark: timing 30 iterations of a, b... a: 26 wallclock secs (26.64 usr + 0.00 sys = 26.64 CPU) @ 1 +.13/s (n=30) b: 32 wallclock secs (31.64 usr + 0.00 sys = 31.64 CPU) @ 0 +.95/s (n=30) Benchmark: timing 30 iterations of a2, b2... a2: 20 wallclock secs (20.10 usr + 0.00 sys = 20.10 CPU) @ 1 +.49/s (n=30) b2: 28 wallclock secs (27.25 usr + 0.00 sys = 27.25 CPU) @ 1 +.10/s (n=30)
It appears that at least some of the difference is due to the order of the tests.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Benchmarking for loops?
by graff (Chancellor) on Jul 13, 2004 at 01:37 UTC | |
by keszler (Priest) on Jul 13, 2004 at 02:40 UTC |