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

Paul Alexander Bilokon,Maximilian Lucuta,Erez Shermer
DOI: https://doi.org/10.1016/j.jpdc.2024.105000
IF: 4.542
2024-10-26
Journal of Parallel and Distributed Computing
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.
computer science, theory & methods
What problem does this paper attempt to address?