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

Unrolling loops is premature optimization, and we all should know what that is the equivalent of.

Unroll your loop once they are tried, tested, and working correctly, and a profiler finds out you spend much too time in the specific parts that would be discarded when unrolling.

The liberties you took with your pseudocode above prove the point: as others have noted, you've chosen premature optimization over using a fitting data type. The first could be easily fixed before release. The latter is harder.



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

Search: