跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 性能

arXiv:2308.14185 (cs)
[提交于 2023年8月27日]

标题:Semi-static Conditions in Low-latency C++ for High Frequency Trading: Better than Branch Prediction Hints

作者:Paul Alexander Bilokon, Maximilian Lucuta, Erez Shermer
查看论文《Semi-static Conditions in Low-latency C++ for High Frequency Trading: Better than Branch Prediction Hints》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:Conditional branches pose a challenge for code optimisation, particularly in low latency settings. For better performance, processors leverage dedicated hardware to predict the outcome of a branch and execute the following instructions speculatively, a powerful optimisation. Modern branch predictors employ sophisticated algorithms and heuristics that utilise historical data and patterns to make predictions, and often, are extremely effective at doing so. Consequently, programmers may inadvertently underestimate the cost of misprediction when benchmarking code with synthetic data that is either too short or too predictable. While eliminating branches may not always be feasible, C++20 introduced the [[likely]] and [[unlikely]] attributes that enable the compiler to perform spot optimisations on assembly code associated with likely execution paths. Can we do better than this? This work presents the development of a novel language construct, referred to as a semi-static condition, which enables programmers to dynamically modify the direction of a branch at run-time by modifying the assembly code within the underlying executable. Subsequently, we explore scenarios where the use of semi-static conditions outperforms traditional conditional branching, highlighting their potential applications in real-time machine learning and high-frequency trading. Throughout the development process, key considerations of performance, portability, syntax, and security were taken into account.
主题: 性能 (cs.PF); 程序设计语言 (cs.PL)
引用方式: arXiv:2308.14185 [cs.PF]
  (或者 arXiv:2308.14185v1 [cs.PF] 对于此版本)
  https://doi.org/10.48550/arXiv.2308.14185

提交历史

来自:Paul Bilokon
[v1] 2023年8月27日 星期日 19:21:47 UTC
全文链接:

访问论文:

  • 查看原文 PDF
  • 中文 PDF (下批处理)
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.PF
< 上一篇   |   下一篇 >
最新 | 近期 | 2023-08
切换浏览方式为:
cs
cs.PL

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站