Logging

Latency numbers every programmer should know

OperationCategoryTypical latency
Register / increment (1 CPU cycle)CPU0.3 ns
L1 cache referenceCPU1 ns
Branch mispredictCPU3 ns
L2 cache referenceCPU4 ns
Main memory (RAM) accessMemory / OS100 ns
Context switchMemory / OS1–3 μs
NVMe SSD read (4 KB)Local I/O100 μs
Roundtrip in same datacenterLocal I/O500 μs
HTTP call, same regionNetwork10–50 ms
Third-party HTTPS API (Stripe, Twilio)Network100–500 ms

Since logging is a I/O operation - the question is how much are we paying for it?