8 ms·
Loop unroll for limit branching. You can sort what's in cache, then load a new chunk of data into cached and sort it ... then merge the sorted chunks.
by infiniteburp 15y ago
Loop unroll for limit branching.
You can sort what's in cache, then load a new chunk of data into cached and sort it ... then merge the sorted chunks.
- Someone 15y agoSometimes, you can also get rid of branches by using arithmetic. For example, see http://stackoverflow.com/questions/1610836/branchless-code-that-maps-zero-negative-and-positive-to-0-1-2 http://stackoverflow.com/questions/1610836/branchless-code-t... or google "Branchless coding".