A very difficult topic, but generally i agree to lostclimate / larrayLaffer (Even though I also use 8 different flags in one byte).

Generally I do not see an advantage (in software/game development for modern computers) if a code gets unreadable in favor of very small optimizations in speed. Probably only 20 more vertices on a model can aborb the effect of a little bit more efficient (see ^= or boolean flags) code.

Nevertheless you should never stop optimizing your code if it's possible to accomplish with effect in affordable time. But As a software-developer I can not explain to my customer that the development of a tool took so long, because several code parts were optimized and now run in a time of 100ns instead of 120ns - which included a lot of research work.

This does not mean, that simple optimization should not be done (for example the swawp above, as a define), but if you do now know such speed-ups - this won't be the reason why your program works slow.


For portable mobile-phone games / apps all above is senseless.