Book Image

Building Low Latency Applications with C++

By : Sourav Ghosh
5 (1)
Book Image

Building Low Latency Applications with C++

5 (1)
By: Sourav Ghosh

Overview of this book

C++ is meticulously designed with efficiency, performance, and flexibility as its core objectives. However, real-time low latency applications demand a distinct set of requirements, particularly in terms of performance latencies. With this book, you’ll gain insights into the performance requirements for low latency applications and the C++ features critical to achieving the required performance latencies. You’ll also solidify your understanding of the C++ principles and techniques as you build a low latency system in C++ from scratch. You’ll understand the similarities between such applications, recognize the impact of performance latencies on business, and grasp the reasons behind the extensive efforts invested in minimizing latencies. Using a step-by-step approach, you’ll embark on a low latency app development journey by building an entire electronic trading system, encompassing a matching engine, market data handlers, order gateways, and trading algorithms, all in C++. Additionally, you’ll get to grips with measuring and optimizing the performance of your trading system. By the end of this book, you’ll have a comprehensive understanding of how to design and build low latency applications in C++ from the ground up, while effectively minimizing performance latencies.
Table of Contents (19 chapters)
1
Part 1:Introducing C++ Concepts and Exploring Important Low-Latency Applications
6
Part 2:Building a Live Trading Exchange in C++
10
Part 3:Building Real-Time C++ Algorithmic Trading Systems
14
Part 4:Analyzing and Improving Performance

Running the entire ecosystem with the new instrumentation system

Running the updated electronic trading ecosystem remains the same as before and is launched by running the following script:

sghosh@sghosh-ThinkPad-X1-Carbon-3rd:~/Building-Low-Latency-Applications-with-CPP/Chapter11$ bash scripts/run_exchange_and_clients.sh

Once the new ecosystem is done running, you can notice performance measurement log entries such as the following for the RDTSC measurements:

sghosh@sghosh-ThinkPad-X1-Carbon-3rd:~/Building-Low-Latency-Applications-with-CPP/Chapter11$ grep Exchange_MEOrderBook_match *.log
exchange_matching_engine.log:02:42:59.980424597 RDTSC Exchange_MEOrderBook_match 205247
exchange_matching_engine.log:02:43:00.022326352 RDTSC Exchange_MEOrderBook_match 216239

There are also entries such as the following for the RDTSC measurements:

sghosh@sghosh-ThinkPad-X1-Carbon-3rd:~/Building-Low-Latency-Applications-with-CPP/Chapter11$ grep Trading_MarketOrderBook_addOrder *.log...