http://www.perlmonks.org?node_id=929757


in reply to computational efficiency

thelycaeum:

Are you even sure it's a problem? You're talking about a couple hundred thousand times, but BrowserUk's benchmark shows that even the slower one is capable of well over a million per second. I'd suggest that if your code is running too slowly, profile it and see which parts take enough time to be worth optimizing. After all, if you can generate a million random sin/cos pairs in a second with the slow method, and need only a few hundred thousand per run, you can't even shave a second off your runtime even if your new version takes *no time at all*.

...roboticus

When your only tool is a hammer, all problems look like your thumb.