Hacker News new | ask | show | jobs
Why is processing a sorted array faster than an unsorted array? (stackoverflow.com)
20 points by gphilip 4080 days ago
3 comments

This is one of the classic posts here:

https://hn.algolia.com/?query=Why%20is%20processing%20a%20so...

Very good comments in some of the submissions

For completeness, a) make the array very big (much much bigger than the LLC) b) split the work amongst cores (make it parallel with your favorite methodology)

  int t = (data[c] - 128) >> 31;
  sum += ~t & data[c];
> They've gone to plaid