TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Why is processing a sorted array faster than an unsorted array?

20 点作者 gphilip大约 10 年前

3 条评论

vmarsy大约 10 年前
This is one of the classic posts here:<p><a href="https:&#x2F;&#x2F;hn.algolia.com&#x2F;?query=Why%20is%20processing%20a%20sorted%20array%20faster%20than%20an%20unsorted%20array%3F&amp;sort=byPopularity&amp;prefix&amp;page=0&amp;dateRange=all&amp;type=story" rel="nofollow">https:&#x2F;&#x2F;hn.algolia.com&#x2F;?query=Why%20is%20processing%20a%20so...</a><p>Very good comments in some of the submissions
etep大约 10 年前
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)
qnaal大约 10 年前
<p><pre><code> int t = (data[c] - 128) &gt;&gt; 31; sum += ~t &amp; data[c]; </code></pre> &gt; They&#x27;ve gone to plaid