Semi-static conditions in low-latency C++ for high frequency trading: Better than branch prediction hints

Conditional branches pose a challenge for code optimisation, particularly in low latency settings. We present 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 (HFT). Throughout the development process, key considerations of performance, portability, syntax, and security were taken into account. • Decoupling of condition evaluation logic and branch taking controlled directly by the programmer. • Semi-static checks demonstrate their real-world applicability, particularly within real-time systems. • The research contribution is encapsulated within a open-source library: https://github.com/maxlucuta/semi-static-conditions . • Focus on syntax, security, efficiency, and portability. • Semi-static conditions can be seamlessly integrated into high-performance real-time systems.

Authors

Institutions

Publication Details

Journal
Journal of Parallel and Distributed Computing
Published
2024-10-24
DOI
https://doi.org/10.1016/j.jpdc.2024.105000
Primary Topic
Advanced Data Storage Technologies
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Semi-static conditions in low-latency C++ for high frequency trading: Better than branch prediction hints

Paul Bilokon, Maximilian Lucuta, Erez Shermer
Journal of Parallel and Distributed Computing
Advanced Data Storage Technologies
article

Semi-static conditions in low-latency C++ for high frequency trading: Better than branch prediction hints

Paul Bilokon, Maximilian Lucuta, Erez Shermer
article en

Abstract

Conditional branches pose a challenge for code optimisation, particularly in low latency settings. We present 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 (HFT). Throughout the development process, key considerations of performance, portability, syntax, and security were taken into account. • Decoupling of condition evaluation logic and branch taking controlled directly by the programmer. • Semi-static checks demonstrate their real-world applicability, particularly within real-time systems. • The research contribution is encapsulated within a open-source library: https://github.com/maxlucuta/semi-static-conditions . • Focus on syntax, security, efficiency, and portability. • Semi-static conditions can be seamlessly integrated into high-performance real-time systems.

Journal of Parallel and Distributed ComputingVol. 196
Imperial College London (GB)
Openalex Percentile: Top 79%
Advanced Data Storage Technologies
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.