internalsGet Pro

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
    1. Introduction to performance engineeringFree (coming soon)
    2. Why performance matters: users, costs and scale (coming soon)
    3. Performance engineering roles: what the job involves (coming soon)
    4. Latency, throughput and utilization: the core ideasFree (coming soon)
    5. Queueing basics: why systems slow down when busyFree (coming soon)
    6. The performance workflow: measure, change, verifyFree (coming soon)
    7. Performance goals and budgets (coming soon)
    8. Performance myths that waste time (coming soon)
    9. Numbers every performance engineer should knowFree (coming soon)
    10. Design: setting performance goals for a checkout page (coming soon)
  • 02How computers run code: CPU, memory and the OS12 lessons
    1. CPU basics: instructions, cycles and clock speed (coming soon)
    2. Pipelines, branches and speculative execution (coming soon)
    3. The memory hierarchy: from registers to diskFree (coming soon)
    4. Virtual memory and page faults (coming soon)
    5. Processes, threads and context switches (coming soon)
    6. System calls: the cost of asking the kernel (coming soon)
    7. Scheduling: how the OS shares CPU time (coming soon)
    8. Storage devices: SSD and disk latency (coming soon)
    9. Network basics for performance: TCP, RTT and bandwidth (coming soon)
    10. Concurrency and parallelism (coming soon)
    11. Containers and VMs: hidden performance costs (coming soon)
    12. Cloud instances: vCPUs, limits and noisy neighbours (coming soon)

Measuring performance

3 modules · 33 lessons

  • 03Performance principles and methodology11 lessons
    1. Measuring latency: what to time and where (coming soon)
    2. Throughput and utilization in practice (coming soon)
    3. Percentiles and tail latency (coming soon)
    4. The USE method: utilization, saturation and errors (coming soon)
    5. The RED method for services (coming soon)
    6. Finding the bottleneck: the limiting resource (coming soon)
    7. Amdahl’s law: the limits of speeding up (coming soon)
    8. Queueing theory for engineers (coming soon)
    9. Performance anti-methods: how not to investigate (coming soon)
    10. Statistics for performance data (coming soon)
    11. Design: diagnosing a slow API end to end (coming soon)
  • 04Benchmarking10 lessons
    1. Benchmarking: measuring performance fairlyFree (coming soon)
    2. Microbenchmarks: traps that give wrong answers (coming soon)
    3. Benchmarking Java code with JMH (coming soon)
    4. Benchmarking Go code with testing.B (coming soon)
    5. Benchmarking Python code with pyperf (coming soon)
    6. Realistic workloads and macrobenchmarks (coming soon)
    7. Warm-up, noise and run-to-run variance (coming soon)
    8. Comparing benchmark results statistically (coming soon)
    9. Continuous benchmarking and regression gates in CI (coming soon)
    10. Common benchmarking mistakes (coming soon)
  • 05Profiling12 lessons
    1. Profiling: finding where the time goes (coming soon)
    2. Sampling and instrumenting profilers (coming soon)
    3. Flame graphs: seeing where CPU time goesFree (coming soon)
    4. Profiling Java with async-profiler and JFR (coming soon)
    5. Profiling Go with pprof (coming soon)
    6. Profiling Python with py-spy and cProfile (coming soon)
    7. Profiling native code with perf (coming soon)
    8. Memory profiling and allocation tracking (coming soon)
    9. Off-CPU analysis: time spent waiting (coming soon)
    10. Lock and contention profiling (coming soon)
    11. Continuous profiling in production (coming soon)
    12. Design: finding a CPU hotspot in a payment service (coming soon)

Code and runtime performance

3 modules · 35 lessons

  • 06Code optimization12 lessons
    1. Algorithms first: complexity on real data (coming soon)
    2. Data structures and memory layout (coming soon)
    3. Memory allocation: the hidden cost in hot code (coming soon)
    4. Reducing allocations: pools, reuse and arenas (coming soon)
    5. Strings, serialization and copying costs (coming soon)
    6. Efficient I/O: buffering, batching and streaming (coming soon)
    7. Memoization and in-process caches (coming soon)
    8. What compilers optimize, and what they can’t (coming soon)
    9. Speeding up Python: NumPy, native code and beyond (coming soon)
    10. Writing fast Go (coming soon)
    11. Writing fast Java (coming soon)
    12. Design: making a slow report generator fast (coming soon)
  • 07Garbage collection and runtimes11 lessons
    1. Memory management: manual, counted and traced (coming soon)
    2. How garbage collectors work (coming soon)
    3. Java garbage collectors: G1 and ZGC in practice (coming soon)
    4. Go’s garbage collector and GOGC (coming soon)
    5. Python memory: reference counting and the GIL (coming soon)
    6. JIT compilation: how runtimes speed up hot code (coming soon)
    7. Startup time and warm-up (coming soon)
    8. Memory leaks in managed languages (coming soon)
    9. Runtime settings for containers (coming soon)
    10. Case: Discord’s garbage collection spikes, Go to Rust (coming soon)
    11. Design: fixing GC pauses in a Java service (coming soon)
  • 08Concurrency and async performance12 lessons
    1. Thread pools: sizing them for the workload (coming soon)
    2. Event loops: one thread, many connections (coming soon)
    3. Async Python with asyncio (coming soon)
    4. Goroutines and the Go scheduler (coming soon)
    5. Java virtual threads in practice (coming soon)
    6. Blocking calls inside async code (coming soon)
    7. Locks, contention and critical sections (coming soon)
    8. Concurrent data structures in practice (coming soon)
    9. Queues and backpressure inside one process (coming soon)
    10. Measuring concurrency: queues and utilization (coming soon)
    11. Free-threaded Python: life without the GIL (coming soon)
    12. Design: from 1,000 to 50,000 connections (coming soon)

Data and distributed performance

2 modules · 24 lessons

  • 09Database and storage performance12 lessons
    1. Database performance: where the time goes (coming soon)
    2. Finding slow queries in production (coming soon)
    3. Indexes in practice: when they help and hurt (coming soon)
    4. N+1 queries and other ORM traps (coming soon)
    5. Connection pools: sizing and wait time (coming soon)
    6. Lock contention and long transactions (coming soon)
    7. Caches in front of databases: measuring hit rates (coming soon)
    8. Disk I/O: IOPS, throughput and latency (coming soon)
    9. File systems and the page cache (coming soon)
    10. Cloud storage bottlenecks: volumes and quotas (coming soon)
    11. Write amplification and compaction costs (coming soon)
    12. Design: speeding up a slow product search page (coming soon)
  • 10Distributed systems performance12 lessons
    1. Network latency: where the milliseconds go (coming soon)
    2. RPC overhead: serialization, connections and hops (coming soon)
    3. HTTP/2, gRPC and connection reuse (coming soon)
    4. Fan-out: how tail latency multiplies (coming soon)
    5. Contention across services (coming soon)
    6. Backpressure and flow control between services (coming soon)
    7. Coordination costs: locks, consensus and transactions (coming soon)
    8. Caching across services: measuring the gain (coming soon)
    9. Timeouts and retries: their performance cost (coming soon)
    10. Data locality and placement (coming soon)
    11. Case: Cloudflare’s Pingora proxy (coming soon)
    12. Design: cutting checkout latency across microservices (coming soon)

Performance at scale and in production

2 modules · 27 lessons

  • 11Load and stress testing13 lessons
    1. Load testing: why, when and what to measureFree (coming soon)
    2. Workload models: describing realistic traffic (coming soon)
    3. JMeter: the most widely used load testing tool (coming soon)
    4. k6, Gatling, Locust and LoadRunner compared (coming soon)
    5. Coordinated omission: why load tests lie (coming soon)
    6. Stress testing: finding the breaking point (coming soon)
    7. Soak tests: finding slow leaks (coming soon)
    8. Spike tests and autoscaling behaviour (coming soon)
    9. Concurrency limits and admission control (coming soon)
    10. Resource utilization under load (coming soon)
    11. Load testing production safely (coming soon)
    12. Reading and reporting load test results (coming soon)
    13. Design: load testing a festival sale (coming soon)
  • 12Production performance14 lessons
    1. Performance signals: what to watch in production (coming soon)
    2. APM tools: what they show and how to use them (coming soon)
    3. Distributed tracing: finding the slow span (coming soon)
    4. Measuring p95 and p99 correctly (coming soon)
    5. Histograms: why averaging percentiles is wrong (coming soon)
    6. Thread dumps, heap dumps and GC logs (coming soon)
    7. Catching performance regressions early (coming soon)
    8. Profiling in production safely (coming soon)
    9. Performance SLOs and error budgets (coming soon)
    10. Capacity planning: from measurements to forecasts (coming soon)
    11. Right-sizing infrastructure (coming soon)
    12. Performance per dollar: infrastructure costs (coming soon)
    13. Performance incidents: diagnosing under pressure (coming soon)
    14. Design: a capacity plan for next year’s growth (coming soon)

Advanced performance

3 modules · 30 lessons

  • 13CPU caches and memory performance10 lessons
    1. CPU caches: lines, levels and misses (coming soon)
    2. Data-oriented design: cache-friendly code (coming soon)
    3. False sharing: when threads fight over a cache line (coming soon)
    4. Prefetching and memory access patterns (coming soon)
    5. Branch prediction and branchless code (coming soon)
    6. SIMD: one instruction, many values (coming soon)
    7. NUMA: near and far memory (coming soon)
    8. Hardware performance counters (coming soon)
    9. Top-down analysis: finding the CPU bottleneck (coming soon)
    10. Design: optimizing a hot loop step by step (coming soon)
  • 14Multicore and lock-free programming10 lessons
    1. Multicore scaling: why more cores don’t always help (coming soon)
    2. Memory models: what each thread can see (coming soon)
    3. Atomics and memory ordering (coming soon)
    4. Lock-free data structures (coming soon)
    5. Wait-free algorithms and the ABA problem (coming soon)
    6. Read-copy-update and other reader-friendly tricks (coming soon)
    7. Sharding work across cores (coming soon)
    8. Thread-per-core architectures (coming soon)
    9. Case: LMAX and the Disruptor (coming soon)
    10. Design: building a lock-free queue (coming soon)
  • 15Kernel-level profiling and high-performance networking10 lessons
    1. Kernel-level profiling with perf (coming soon)
    2. eBPF: safe programs inside the kernel (coming soon)
    3. eBPF tools: bcc and bpftrace (coming soon)
    4. Tracing system calls and scheduler delays (coming soon)
    5. The Linux network stack and its costs (coming soon)
    6. Tuning TCP and network buffers (coming soon)
    7. io_uring: fast asynchronous I/O (coming soon)
    8. Kernel bypass: DPDK, XDP and RDMA (coming soon)
    9. Zero-copy techniques (coming soon)
    10. Design: a low-latency network service (coming soon)

Capstone and interviews

2 modules · 17 lessons

  • 16Capstone: build, benchmark and optimize9 lessons
    1. Capstone overview: build, benchmark, optimize (coming soon)
    2. Capstone step 1: building the application (coming soon)
    3. Capstone step 2: baseline benchmarks (coming soon)
    4. Capstone step 3: profiling under load (coming soon)
    5. Capstone step 4: code and runtime fixes (coming soon)
    6. Capstone step 5: database and I/O fixes (coming soon)
    7. Capstone step 6: distributed bottlenecks (coming soon)
    8. Capstone step 7: load and stress testing (coming soon)
    9. Capstone step 8: measuring and reporting the gains (coming soon)
  • 17Performance engineering interviews8 lessons
    1. Performance engineering interviews: what’s testedFree (coming soon)
    2. Explaining latency and throughput clearly (coming soon)
    3. Debugging interviews: a service is slow (coming soon)
    4. Estimation and capacity interview questions (coming soon)
    5. Low-level questions: caches, threads and GC (coming soon)
    6. Common mistakes in performance interviews (coming soon)
    7. Mock interview: a slow API in production (coming soon)
    8. Mock interview: designing a load test (coming soon)