
Available on Amazon: LLTI vol 2
Link: https://www.amazon.com/Low-Latency-Trading-Insights-Measured/dp/B0HM1PQP2V “Pass small structs by value.” “A computed goto beats a switch.” “Turn the prefetchers off.” Thirteen rules every low-latency engineer repeats, measured on eight machines. The same code keeps returning opposite verdicts. One source-level rewrite runs 3.65 times faster on a Zen 2 server, 3.17 times on Comet Lake, and not at all on Zen 5 once the compiler may use AVX-512. A computed goto that beats the switch under Clang loses to it under GCC 14. The same prefetcher setting is free on one Intel core and doubles the tail on another. Eight of the thirteen verdicts turn on the platform: the chip, the compiler, its version, a flag or the kernel. That makes the machine you buy a performance decision, to be taken on your own workload before the order is signed. From a 15-year HFT veteran and author of Low Latency Trading Insights. Volume 1 built the mental model; this volume puts the folklore it produces on isolated cores and prints what the silicon said, including the times the author was wrong. Most experiments recorded their predictions before they ran, and every chapter scores them against the result: ninety-five scored predictions, thirty-eight right, twenty-eight flatly wrong. Every claim ends in one of four words, holds, holds when, reversed or dead, and holds when is the most common, because the condition the rule forgot to mention is usually the chip or the compiler. What’s Inside:How This Series Measures * The machines, what an isolated core buys, and what it costs to work without one * Profiling the hot path in production, not the hot function * Histograms that don’t lie: log bins with per-bin moments Layout and Memory * Struct size, layout and the ABI: byte-count folklore, measured on five machines * Two conforming compilers, same hardware, same source, 5.4 times apart on one struct when caller and callee share a file * A prefetcher configuration bit that raises the median by half on one Intel core and does nothing on another Branches and Dispatch * The useful branch: speculation as a dependency breaker * switch, computed goto, musttail: who really wins dispatch, and on which compiler The Compiler’s Silent Decisions * llvm-mca against silicon: when the model is right, and whose scheduling tables it is really running * Why the vectorizer walked away from a loop with two entrances, and said nothing * The sort that lied to the compiler: restrict, undefined behavior, and a stock build returning unsorted data The Kernel and the Clock * Isolation alone is not enough: PREEMPT_RT and what still gets in * The clock is a shared data structure: a timestamp read that subscribes a quiet core to a noisy one’s cache traffic How the numbers are made: * Cores isolated with isolcpus, nohz_full and rcu_nocbs; every other machine disclosed where it is used, with the reason its numbers stand * A median and a spread rather than a bare mean; a difference smaller than the spread is called a tie, not a finding * A verification gate: bit-identical output from every implementation before anything is timed * Corrections in print, including to Volume 1, wherever the measurements disagree Who This Book Is For: * C++ developers who already write latency-sensitive code and want to know which rules hold on their hardware, with their compiler * Engineers and leads who choose the hardware * Readers of Volume 1 who want the evidence Eight machines, GCC 11 through 16, Clang 18 through 22, every number recomputed from its raw files wherever they were kept. Volume 1 is the better book to learn from. This one is the better book to argue with. Get full access to Low Latency Trading Insights at lucisqr.substack.com/subscribe
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
