Hacker News new | past | comments | ask | show | jobs | submit login

The key thing missing is if it makes the loop much bigger. if

That example does not make the loop much bigger, since it's trivial to combine multiple of these additions to one bigger one (even assuming that extra checks for overflow behavior might be needed, depending on the data type). Many other operations do not compress like this, e.g. those that iterate over many elements in a large data structure, need temporary results, ... Then loop unrolling likely causes costly cache misses.




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

Search: