==============================
== What I have learnt today ==
==============================

C++ in trading systems

In Trading at light speed: designing low latency systems in C++, David Gross first defines what low latency means. The trigger to target latency is 20-40ns. In order to achieve such low latency, the software is running on FPGA. Then he moved the discussion to data.

Data model accounted for a substantial amount of time in his presentation. One key idea is that, if the data model is not designed with performance in mind, it will slow down the system. The size and locality of the data are two important attributes that need to be taken care of. The data model is called instrument store. It is a core element of his algo (algorithm?). The size is less than 1 kb.

The concept working set size (WSS) is introduced. During the discussion of WSS, I come to know the author Brendan Gregg and his famous work Systems Performance: Enterprise and the Cloud, 2nd Edition (2020). The book is so famous that if you understands it thoroughly, you can get hired right away.

Back to the presentation. David introduced various locking mechanisms. SEQLock is one of them. He then continued with SPMC (Single Producer Multiple Consumers) queues and his enhancements. Finally the SPMC queue becomes the SEQLock. Cool. He should seriously consider to be a novel writer.

Then he moved on to system performance. In this par he mentioned the C-state and P-state of the CPU. The impact of L3 cache protocols to the CPU performance.

During the presentation, sometimes the X86_64 asm code is displayed alongside the C++ code. He mentioned that the program is running on FGPA. IMHO, there are a vast amount of technologies and efforts are invested in how to optimize the program running on it.

He has also mentioned that TCP and UDP are used to transfer trading messages. It is very likely that those protocols are heavily optimized version.

To be honest, I only understand less than 50% of the presentation. But at least it gets me to know, or have a basic idea, of how C++ is used in a trading environment.