A performance-oriented C++ repository documenting the path from standard systems programming to Low-Latency and High-Frequency Trading (HFT) architectures.
This project implements core components of a trading engine (Feed Handler, Order Book) enforcing strict memory management constraints typical of financial execution venues.
- Zero-Copy Parsing: Implementation of a CSV Feed Handler using
std::string_viewandstd::movesemantics to minimize memory bandwidth usage during market data processing. - Deterministic Memory Management: Strict adherence to RAII principles. Usage of
std::vector::reserveand custom pre-allocation patterns to prevent heap allocations (malloc/free) on the critical path (Hot Path). - Cache Locality: Data-Oriented Design (DOD) using contiguous memory layouts (POD Structs) for Order Book entries, maximizing L1/L2 cache hits.
- Type Safety without Overhead: Usage of
explicitconstructors and strong typing to prevent implicit conversion bugs at compile-time, with zero runtime cost.
- Parses simulated market data (Tickers, Prices, Sizes).
- Optimization: Replaces standard
std::stringcopies with move semantics, reducing parsing latency. - Input: High-throughput CSV streams.
- Manages the state of Buy/Sell orders in memory.
- Optimization: Encapsulated logic with
privatememory management to guarantee capacity constraints (preventing unwanted resizing).
- C++ Primer (5th Edition) - Stanley B. Lippman
- Computer Systems: A Programmer's Perspective (CS:APP) - Randal E. Bryant
- Operating Systems: Three Easy Pieces (OSTEP) - Remzi H. Arpaci-Dusseau