全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Quantitative Finance · 术语表

什么是 Branch prediction, branch misprediction?

又称: branch prediction · branch misprediction

Definition 2.5 Low-Latency Software · 第 2 章 — CPU Microarchitecture

Branch prediction is the core’s guess, made at fetch, of the direction and target of each branch, so that the pipeline can keep fetching before the branch is executed. A branch misprediction is a wrong guess: the core discards every instruction fetched after the branch and refetches from the right target, losing the depth of the front of the pipeline in cycles.

The loop of the 2012 question (sum the elements 128 of 32 768 random bytes) with a branch and with a mask, on sorted and shuffled data. Measured on a laptop (Intel Core Ultra 7 155H) under WSL2, no isolated cores, pinned to one CPU, best of 30 runs. Data: bench_cpu.py.
Figure 2.3. The loop of the 2012 question (sum the elements ≥128\ge 128 of 32 768 random bytes) with a branch and with a mask, on sorted and shuffled data. Measured on a laptop (Intel Core Ultra 7 155H) under WSL2, no isolated cores, pinned to one CPU, best of 30 runs. Data: bench_cpu.py.
在原文中阅读 →