Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Rather than conditionally execute code (to avoid performing an unnecessary expensive operation) always execute the code, then discard the result if it is unneeded. The idea being that the performance gained by avoiding the unnecessary operation is not worth the complexity added.


As a minor note, conditional checks can have significant performance impacts if you don't consistently handle the conditional.

As an example performing an operation every other frame can cause your CPU to thrash due to always taking the wrong path. (I of course am oversimplifying and OOO CPUs are quite complex)


Also adds consistency, which I'm sure is important in realtime games




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: