Inspired by the result of previous test I've made another benchmark:
How functions speed-up simplest expressions - in this case I wondered what
about loop indexing.
I compared speed of two scripts:
Note difference: first script use function to decrease value of parameter.
Both scripts were started three times on PII 233 with 128 MB (3.5 b 11).
Result: measuring CPU time first script was little faster then second about:
- kernel time: 5,64%
- user time: 11,00%
- total time: 9,38%
Then I compared the same replacement for increased index of loop.
In this case there is no difference in speed. It changed from test to test. It
was around +/- 2%. Not big deal in this case.
Additional note: there was the same number of interations but version with
decreasing was faster (20-30%) than version with increasing (probably becouse
of no additional tokens in loop condition).
Any comments ?
Post a reply to this message