Epicboy's original point was correct, even if it could have been put more diplomatically, and could be stated thus:
1) Write your program as simply and cleanly as you can.
2) When you're finished, if performance is an issue, profile your code to find the bottlenecks.
3) Optimize where it will do the most good.
A program that is finished is infinitely preferable to a faster program that isn't finished.
As for the example at hand:
It's almost certain that using a lookup table for trig functions will be faster than not doing so -- but the odds of this being significant with today's hardware is fairly small, and it may cause visual artifacts (non-smooth rotations, jerky control behavior).
More important, there's the question of OPPORTUNITY COST. You could spend the time you've spent optimizing something that doesn't NEED to be optimised optimizing something that DOES. And by optimising too soon you're also making code more difficult to maintain (optimised code almost always is nastier than unoptimised, the exception being when you find a more elegant way to do something) and debug (you know than sin() works; does your optimised version work?).
1) Write your program as simply and cleanly as you can.
2) When you're finished, if performance is an issue, profile your code to find the bottlenecks.
3) Optimize where it will do the most good.
A program that is finished is infinitely preferable to a faster program that isn't finished.
As for the example at hand:
It's almost certain that using a lookup table for trig functions will be faster than not doing so -- but the odds of this being significant with today's hardware is fairly small, and it may cause visual artifacts (non-smooth rotations, jerky control behavior).
More important, there's the question of OPPORTUNITY COST. You could spend the time you've spent optimizing something that doesn't NEED to be optimised optimizing something that DOES. And by optimising too soon you're also making code more difficult to maintain (optimised code almost always is nastier than unoptimised, the exception being when you find a more elegant way to do something) and debug (you know than sin() works; does your optimised version work?).