Performance Engineering: Know why your
code is slow
Measure, profile and speed up software, from one service down to CPU caches and the Linux kernel.
- Lessons
- 188
- Modules
- 17
- Parts
- 7
- Free to read
- 10
Foundations
2 modules · 22 lessons
01Performance engineering fundamentals10 lessons
- Introduction to performance engineeringFree (coming soon)
- Why performance matters: users, costs and scale (coming soon)
- Performance engineering roles: what the job involves (coming soon)
- Latency, throughput and utilization: the core ideasFree (coming soon)
- Queueing basics: why systems slow down when busyFree (coming soon)
- The performance workflow: measure, change, verifyFree (coming soon)
- Performance goals and budgets (coming soon)
- Performance myths that waste time (coming soon)
- Numbers every performance engineer should knowFree (coming soon)
- Design: setting performance goals for a checkout page (coming soon)
02How computers run code: CPU, memory and the OS12 lessons
- CPU basics: instructions, cycles and clock speed (coming soon)
- Pipelines, branches and speculative execution (coming soon)
- The memory hierarchy: from registers to diskFree (coming soon)
- Virtual memory and page faults (coming soon)
- Processes, threads and context switches (coming soon)
- System calls: the cost of asking the kernel (coming soon)
- Scheduling: how the OS shares CPU time (coming soon)
- Storage devices: SSD and disk latency (coming soon)
- Network basics for performance: TCP, RTT and bandwidth (coming soon)
- Concurrency and parallelism (coming soon)
- Containers and VMs: hidden performance costs (coming soon)
- Cloud instances: vCPUs, limits and noisy neighbours (coming soon)
Measuring performance
3 modules · 33 lessons
03Performance principles and methodology11 lessons
- Measuring latency: what to time and where (coming soon)
- Throughput and utilization in practice (coming soon)
- Percentiles and tail latency (coming soon)
- The USE method: utilization, saturation and errors (coming soon)
- The RED method for services (coming soon)
- Finding the bottleneck: the limiting resource (coming soon)
- Amdahl’s law: the limits of speeding up (coming soon)
- Queueing theory for engineers (coming soon)
- Performance anti-methods: how not to investigate (coming soon)
- Statistics for performance data (coming soon)
- Design: diagnosing a slow API end to end (coming soon)
04Benchmarking10 lessons
- Benchmarking: measuring performance fairlyFree (coming soon)
- Microbenchmarks: traps that give wrong answers (coming soon)
- Benchmarking Java code with JMH (coming soon)
- Benchmarking Go code with testing.B (coming soon)
- Benchmarking Python code with pyperf (coming soon)
- Realistic workloads and macrobenchmarks (coming soon)
- Warm-up, noise and run-to-run variance (coming soon)
- Comparing benchmark results statistically (coming soon)
- Continuous benchmarking and regression gates in CI (coming soon)
- Common benchmarking mistakes (coming soon)
05Profiling12 lessons
- Profiling: finding where the time goes (coming soon)
- Sampling and instrumenting profilers (coming soon)
- Flame graphs: seeing where CPU time goesFree (coming soon)
- Profiling Java with async-profiler and JFR (coming soon)
- Profiling Go with pprof (coming soon)
- Profiling Python with py-spy and cProfile (coming soon)
- Profiling native code with perf (coming soon)
- Memory profiling and allocation tracking (coming soon)
- Off-CPU analysis: time spent waiting (coming soon)
- Lock and contention profiling (coming soon)
- Continuous profiling in production (coming soon)
- Design: finding a CPU hotspot in a payment service (coming soon)
Code and runtime performance
3 modules · 35 lessons
06Code optimization12 lessons
- Algorithms first: complexity on real data (coming soon)
- Data structures and memory layout (coming soon)
- Memory allocation: the hidden cost in hot code (coming soon)
- Reducing allocations: pools, reuse and arenas (coming soon)
- Strings, serialization and copying costs (coming soon)
- Efficient I/O: buffering, batching and streaming (coming soon)
- Memoization and in-process caches (coming soon)
- What compilers optimize, and what they can’t (coming soon)
- Speeding up Python: NumPy, native code and beyond (coming soon)
- Writing fast Go (coming soon)
- Writing fast Java (coming soon)
- Design: making a slow report generator fast (coming soon)
07Garbage collection and runtimes11 lessons
- Memory management: manual, counted and traced (coming soon)
- How garbage collectors work (coming soon)
- Java garbage collectors: G1 and ZGC in practice (coming soon)
- Go’s garbage collector and GOGC (coming soon)
- Python memory: reference counting and the GIL (coming soon)
- JIT compilation: how runtimes speed up hot code (coming soon)
- Startup time and warm-up (coming soon)
- Memory leaks in managed languages (coming soon)
- Runtime settings for containers (coming soon)
- Case: Discord’s garbage collection spikes, Go to Rust (coming soon)
- Design: fixing GC pauses in a Java service (coming soon)
08Concurrency and async performance12 lessons
- Thread pools: sizing them for the workload (coming soon)
- Event loops: one thread, many connections (coming soon)
- Async Python with asyncio (coming soon)
- Goroutines and the Go scheduler (coming soon)
- Java virtual threads in practice (coming soon)
- Blocking calls inside async code (coming soon)
- Locks, contention and critical sections (coming soon)
- Concurrent data structures in practice (coming soon)
- Queues and backpressure inside one process (coming soon)
- Measuring concurrency: queues and utilization (coming soon)
- Free-threaded Python: life without the GIL (coming soon)
- Design: from 1,000 to 50,000 connections (coming soon)
Data and distributed performance
2 modules · 24 lessons
09Database and storage performance12 lessons
- Database performance: where the time goes (coming soon)
- Finding slow queries in production (coming soon)
- Indexes in practice: when they help and hurt (coming soon)
- N+1 queries and other ORM traps (coming soon)
- Connection pools: sizing and wait time (coming soon)
- Lock contention and long transactions (coming soon)
- Caches in front of databases: measuring hit rates (coming soon)
- Disk I/O: IOPS, throughput and latency (coming soon)
- File systems and the page cache (coming soon)
- Cloud storage bottlenecks: volumes and quotas (coming soon)
- Write amplification and compaction costs (coming soon)
- Design: speeding up a slow product search page (coming soon)
10Distributed systems performance12 lessons
- Network latency: where the milliseconds go (coming soon)
- RPC overhead: serialization, connections and hops (coming soon)
- HTTP/2, gRPC and connection reuse (coming soon)
- Fan-out: how tail latency multiplies (coming soon)
- Contention across services (coming soon)
- Backpressure and flow control between services (coming soon)
- Coordination costs: locks, consensus and transactions (coming soon)
- Caching across services: measuring the gain (coming soon)
- Timeouts and retries: their performance cost (coming soon)
- Data locality and placement (coming soon)
- Case: Cloudflare’s Pingora proxy (coming soon)
- Design: cutting checkout latency across microservices (coming soon)
Performance at scale and in production
2 modules · 27 lessons
11Load and stress testing13 lessons
- Load testing: why, when and what to measureFree (coming soon)
- Workload models: describing realistic traffic (coming soon)
- JMeter: the most widely used load testing tool (coming soon)
- k6, Gatling, Locust and LoadRunner compared (coming soon)
- Coordinated omission: why load tests lie (coming soon)
- Stress testing: finding the breaking point (coming soon)
- Soak tests: finding slow leaks (coming soon)
- Spike tests and autoscaling behaviour (coming soon)
- Concurrency limits and admission control (coming soon)
- Resource utilization under load (coming soon)
- Load testing production safely (coming soon)
- Reading and reporting load test results (coming soon)
- Design: load testing a festival sale (coming soon)
12Production performance14 lessons
- Performance signals: what to watch in production (coming soon)
- APM tools: what they show and how to use them (coming soon)
- Distributed tracing: finding the slow span (coming soon)
- Measuring p95 and p99 correctly (coming soon)
- Histograms: why averaging percentiles is wrong (coming soon)
- Thread dumps, heap dumps and GC logs (coming soon)
- Catching performance regressions early (coming soon)
- Profiling in production safely (coming soon)
- Performance SLOs and error budgets (coming soon)
- Capacity planning: from measurements to forecasts (coming soon)
- Right-sizing infrastructure (coming soon)
- Performance per dollar: infrastructure costs (coming soon)
- Performance incidents: diagnosing under pressure (coming soon)
- Design: a capacity plan for next year’s growth (coming soon)
Advanced performance
3 modules · 30 lessons
13CPU caches and memory performance10 lessons
- CPU caches: lines, levels and misses (coming soon)
- Data-oriented design: cache-friendly code (coming soon)
- False sharing: when threads fight over a cache line (coming soon)
- Prefetching and memory access patterns (coming soon)
- Branch prediction and branchless code (coming soon)
- SIMD: one instruction, many values (coming soon)
- NUMA: near and far memory (coming soon)
- Hardware performance counters (coming soon)
- Top-down analysis: finding the CPU bottleneck (coming soon)
- Design: optimizing a hot loop step by step (coming soon)
14Multicore and lock-free programming10 lessons
- Multicore scaling: why more cores don’t always help (coming soon)
- Memory models: what each thread can see (coming soon)
- Atomics and memory ordering (coming soon)
- Lock-free data structures (coming soon)
- Wait-free algorithms and the ABA problem (coming soon)
- Read-copy-update and other reader-friendly tricks (coming soon)
- Sharding work across cores (coming soon)
- Thread-per-core architectures (coming soon)
- Case: LMAX and the Disruptor (coming soon)
- Design: building a lock-free queue (coming soon)
15Kernel-level profiling and high-performance networking10 lessons
- Kernel-level profiling with perf (coming soon)
- eBPF: safe programs inside the kernel (coming soon)
- eBPF tools: bcc and bpftrace (coming soon)
- Tracing system calls and scheduler delays (coming soon)
- The Linux network stack and its costs (coming soon)
- Tuning TCP and network buffers (coming soon)
- io_uring: fast asynchronous I/O (coming soon)
- Kernel bypass: DPDK, XDP and RDMA (coming soon)
- Zero-copy techniques (coming soon)
- Design: a low-latency network service (coming soon)
Capstone and interviews
2 modules · 17 lessons
16Capstone: build, benchmark and optimize9 lessons
- Capstone overview: build, benchmark, optimize (coming soon)
- Capstone step 1: building the application (coming soon)
- Capstone step 2: baseline benchmarks (coming soon)
- Capstone step 3: profiling under load (coming soon)
- Capstone step 4: code and runtime fixes (coming soon)
- Capstone step 5: database and I/O fixes (coming soon)
- Capstone step 6: distributed bottlenecks (coming soon)
- Capstone step 7: load and stress testing (coming soon)
- Capstone step 8: measuring and reporting the gains (coming soon)
17Performance engineering interviews8 lessons
- Performance engineering interviews: what’s testedFree (coming soon)
- Explaining latency and throughput clearly (coming soon)
- Debugging interviews: a service is slow (coming soon)
- Estimation and capacity interview questions (coming soon)
- Low-level questions: caches, threads and GC (coming soon)
- Common mistakes in performance interviews (coming soon)
- Mock interview: a slow API in production (coming soon)
- Mock interview: designing a load test (coming soon)