TLDR Tech / Crypto
Chasing Microseconds: Lighter's Latency Engineering
Lighter's engineering team cut end-to-end p99 latency from 280ms to a flat 55ms and transaction-processing p99 from 20-30ms spikes to under 1ms, hitting a mainnet ATH of 811 million transactions in a day (9,388 TPS average, 20,740 TPS peak) on June 5. The gains came from stacking several changes: eliminating heap allocations by swapping big.Int/big.Rat for stack-allocated int128/float64 and using atomic immutable order-book snapshots, GOGC tuning that cut GC pause times roughly 3x, a new in-memory snapshot service enabling zero-warm-up deploys, and hand-rolled binary serialization to kill reflection overhead on the internal message bus. CPU-level work, including goroutine-to-thread pinning, SCHED_FIFO scheduling, and consolidating API servers onto single-NUMA-node machines to dodge a 10x cross-node memory penalty, pushed hot-path apply time down to 100-250 microseconds. The sequencer decouples proof generation from execution entirely, so trader-facing latency is governed solely by the execution and API layers rather than proving throughput.
Read the full story