From a market-data packet to an order in microseconds — fifteen topics, one system. This is a graduate C++ course in which the deliverable is a trading bot that reacts to a live order book faster than the bot sitting next to it, and the grade is a percentile: p50, p99 and p99.9 of tick-to-trade. Every topic below is one stage of that path, or one C++ tool you need to make that stage cheap.
The material is taught in two formats. A 15-week track gives each topic its own session; a condensed 9-session track groups them into nine longer meetings, following the order the language is taught in: pointers, then classes, then polymorphism, then templates. Nothing is dropped. Flip the switch and watch the fifteen cards regroup.
Before any of this is useful you need a physical sense of the units. Pick one and see what fits inside it — the numbers are the reason this course exists.
This is the whole course in one diagram. A packet lands on the NIC; some number of nanoseconds later an order leaves it. Every stage below is owned by a topic on the map, and every stage is a slider. Move them, switch the kernel off, and watch the total cross the budget line — because the budget is not the mean, it is the tail, and the tail is what you are graded on.
Ticks are kept only in this browser tab and nothing is sent anywhere. No GPU and no cloud account is needed for any topic in this course; a laptop and a release build are the whole lab.
-std=c++20 is rejectedThe course uses designated initialisers, constexpr containers,
concepts in a couple of places, and std::span. A 2019-vintage compiler will not do.
Fix: GCC 11+ or Clang 13+. On macOS, Apple Clang from a current Xcode is fine;
clang++ -std=c++20 -E -x c++ - < /dev/null is a one-line smoke test.
You measured nothing. At -O2 the optimiser deletes work whose
result is never read, and your timing loop is exactly that.
Fix: sink every result through a doNotOptimize helper, and never
benchmark a debug build. Week 2 does this properly.
perf is not availableperf is Linux-only, and even there it needs
perf_event_paranoid relaxed. On macOS the equivalents are
xctrace, sample and Instruments.
Fix: do the sampling work on Linux (a container or a small VM is enough), or use
the platform profiler — but keep the steady_clock harness as the number of record,
because it is the one that matches the grader.
Almost always false sharing: two hot variables landing on one 64-byte cache line, so two cores invalidate each other on every write.
Fix: alignas(64) on each hot counter. Week 2 reproduces the
regression and Week 9 explains the coherency traffic underneath it.
cmake -B build.