Something I was taught in CS class years ago that I've found to hold true:
when writing code, make it: 1
easy to understand (and therefore easier to maintain)
Performance comes last
. Only worry about performance if you find there is a performance problem when executing your correct, clearly written code.
As westfw says, you can just write the code and let the compiler work its magic. (I suspect black
magic at high optimization levels.