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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Branch prediction: fundamentals every programmer need not know

70 点作者 mycpuorg超过 5 年前

5 条评论

vowelless超过 5 年前
Very shallow. I prefer the popular stack overflow answer by Mystical:<p><a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;11227809&#x2F;why-is-processing-a-sorted-array-faster-than-processing-an-unsorted-array" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;11227809&#x2F;why-is-processi...</a>
评论 #22219108 未加载
评论 #22219363 未加载
CalChris超过 5 年前
&quot;This results in a loss of a single cycle at the time of instruction fetch.&quot; Maybe on that paper CPU but branch mis-predicts on Skylake are 16.5 cycles if there&#x27;s a μop cache hit and 19-20 cycles if there isn&#x27;t.<p><a href="https:&#x2F;&#x2F;www.7-cpu.com&#x2F;cpu&#x2F;Skylake.html" rel="nofollow">https:&#x2F;&#x2F;www.7-cpu.com&#x2F;cpu&#x2F;Skylake.html</a><p>That said, I didn&#x27;t know about using BPM to access the PMC performance registers.
stygiansonic超过 5 年前
Rekated: Dan Luu&#x27;s article on branch prediction is pretty good: <a href="https:&#x2F;&#x2F;danluu.com&#x2F;branch-prediction&#x2F;" rel="nofollow">https:&#x2F;&#x2F;danluu.com&#x2F;branch-prediction&#x2F;</a>
azinman2超过 5 年前
Feels very shallow. I was surprised to reach the end of the article so quickly.
评论 #22219127 未加载
jbverschoor超过 5 年前
What is the power consumption hit with prediction?
评论 #22218230 未加载
评论 #22218020 未加载