3 ms·
That's been my experience too, not just of Duff's device but in general with trying to unroll loops. There may have been a point where it was practical (althoug
by sago 11y ago
That's been my experience too, not just of Duff's device but in general with trying to unroll loops. There may have been a point where it was practical (although early in my career I didn't do the profile-first-optimise-later thing very well, I confess). But if you think you can manually unroll a loop in a way that beats the branch predictor and a good compiler on most modern hardware, you're probably fooling yourself.
- nwmcsween 11y agoEh, this is still relevant, loop unrolling can still have a drastic effect if the compiler cannot optimize.
- sago 11y agoI suspect I'm just not in the group of people for whom it is relevant any more. Way back I was optimising for console hardware when that hardware was quite rudimentary. Now the hardware is much more sophisticated, I don't need it. Can you say what kind of stuff and in what kinds of situations you unroll loops. Just out of curiosity.