All Writing

Latency doesn’t come from one place. It accumulates across the entire system

·1 min read

Lately I’ve been trying to understand how machines actually communicate and where latency comes from.

A few things that changed how I think:
- A socket is basically a communication endpoint between processes.
- IP addresses identify machines, but ports decide which process receives the data.
- TCP prioritizes reliability and correctness.
- UDP prioritizes speed and low latency.
- In HFT systems, stale market data can be more dangerous than missing data.

The biggest realization was that latency is everywhere.
Not just in slow internet, but in:
- network travel
- kernel processing
- memory access
- scheduling
- queues
- application logic

The deeper I go, the more I realize modern software is mostly systems exchanging messages under constraints.
And most optimization work is really about removing waiting.