fastbook · C++23 · in progress

  • Market-data pipeline that builds limit order books: the feed thread shards instruments to per-instrument book builders on core-pinned threads over lock-free SPSC queues. 3.3 µs p50, 14 µs p99 tick-to-book over a full NASDAQ day at 1M msgs/s.
  • Generic API over transports (UDP multicast, io_uring TCP, AF_XDP) and protocols (MoldUDP64, ITCH 5.0).
  • Custom memory management: lock-free, run-based size-class allocator with thread-local caches and huge pages, plus object pools, to keep heap allocation off the hot path.
  • Profiling library: rdtscp timing, log-linear histograms and perf_event_open hardware counters.
  • Async logger: 19 ns per call on the hot thread, 29x faster than std::ofstream, 73x faster than write() (blog post).
  • SIMD open-addressing hash table for the order map: up to 3.3x faster than std::unordered_map (blog post).

Redis server · Rust

Implemented a Redis server from scratch: strings, lists, streams, transactions, replication, persistence, key expiry, pub/sub and authentication, on an async event loop with Tokio channels and a RESP3 parser.

Transactional memory · C++ · EPFL Concurrent Algorithms

Implemented a TL2-style software transactional memory: a global version clock, a striped table of versioned write locks, buffered writes committed under ordered lock acquisition, and read-set validation, with a fast path for read-only transactions.

MySTL · C++

Implemented STL containers from scratch - vector, list, priority queue, red-black-tree map, set, multimap and multiset, and hash-based unordered containers - with STL-compatible iterators, benchmarked against the standard library.

Fault-tolerant network protocols · C++

Implemented 3 fault-tolerant protocols for reliable communication over UDP on a multi-threaded epoll event loop.

Nex2Chat · Go

Fully decentralized P2P social network: a Chord DHT for storage and Paxos for state management, no central servers.