Keith Devens .com |
Tuesday, October 7, 2008 | ![]() |
| I was always told, that if I ain't gonna be part of the greatest, I gotta be the greatest... – Busta Rhymes | ||
|
| ← Keeping our promises (or... Long Live Iraq!) | Dates and times on my site → |

Aggelos wrote:
Ehud (http://lambda-the-ultimate.org) wrote:
Jon Bentley has a nice column on profileers, with the running example of calculating prime numbers. Amusingly when I translated the code to Ada the problem with recalculating the sqrt each iteration disappeared...
Feel free to post a comment below. Please see my comment policy.
Formatting Rules (No HTML):
Generated in about 0.252s.
(Used 8 db queries)

It is important for PHP too. Say, give it a 1000000 loops without pre-calculation and with pre-calculation. And compare the results. Of course there is no difference if you have 10 or 100 loops. But for big numbers, the difference is quite noticeable.