Wiki: Beyond Big O: real world performance explained
For agents: Markdown version · Wiki index · Explore
- Speaker: Avishai Ish Shalom
- Event: Reversim Summit 2024
- Video: https://www.youtube.com/watch?v=MVkIplMDDSk
- Transcript: /transcripts/2024/36-MVkIplMDDSk.md
- Language: Hebrew · Type: talk · Level: intermediate
- Topics: Performance, Distributed Systems, Scalability, Architecture
Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.
Summary
The speaker argues that traditional Big O notation is inadequate for real-world performance engineering because it ignores hardware architecture, implementation details, and statistical distributions. Instead, the speaker introduces an alternative model based on queuing theory, interaction buffers, and statistical variance. The audience learns how phenomena like head-of-line blocking, batching, fragmentation, and request retries impact latency and throughput in complex distributed systems. Ultimately, the talk demonstrates how discrete event simulation can be used to analyze and optimize system designs before writing production code.
Key points
- 1:02 Minor implementation differences in matrix multiplication can cause a five-fold performance variance despite having the same Big O complexity.
- 2:15 Real-world performance exhibits statistical distributions rather than the neat, predictable lines forecasted by algorithmic complexity models.
- 8:58 Interaction buffers between components handle specific quantum sizes and introduce queuing delays that dictate actual system latency.
- 13:07 Queuing behavior is strictly non-linear, meaning latency spikes exponentially as resource utilization approaches maximum capacity.
- 22:48 Timeouts convert unhandled errors into latency, while retries can cause throughput degradation and cascading failure amplification.
- 27:04 Multi-layered architectures create read, write, and latency amplifications that dramatically increase total request execution time.
- 29:35 Load management and backpressure mechanisms are essential to prevent infinite queue growth and system collapse.
- 34:54 Discrete event simulation tools allow developers to model complex system interactions and test architectural trade-offs safely.
Takeaways
- Avoid running production queues at extremely high utilization rates because latency increases exponentially.
- Reduce statistical variance in your workloads to drastically improve system performance.
- Be cautious of arbitrary timeout values in your code, as they directly translate errors into latency.
- Use discrete event simulation to model system bottlenecks and test architectural changes before implementation.
Questions this talk answers
- Why does high resource utilization cause exponential latency increases in real-world systems?
- How can I use queuing theory to model and optimize microservices architectures?
- What is the performance trade-off between batching requests and maintaining low latency?
Technologies
C, C++, Kafka, TCP, SimPy
Tags
latency, performance, queuing theory, scalability, simulation, system architecture, throughput