A Practical Guide to Building Fast, Scalable Systems from Hardware to Distributed Architecture
Chapter 1: The Performance Engineering Mindset
- What Is Performance (Latency, Throughput, Efficiency, Scalability)
- The Performance Lifecycle (Requirements, Baseline, Profile, Optimize, Validate, Monitor)
- First Principles Thinking for Performance
- Common Anti-Patterns and Misconceptions
- How to Use This Book
Chapter 2: Defining Performance Requirements and SLOs
- Translating Business Needs into Performance Metrics
- Designing SLIs and SLOs That Matter
- Understanding Latency Distributions and Tail Latency
- Capacity Planning Fundamentals
- Setting Realistic Performance Targets by Domain
Chapter 3: CPU Microarchitecture and Instruction-Level Behavior
- How Modern CPUs Execute Instructions (Pipelines, Superscalar, Out-of-Order)
- Branch Prediction and Control Flow Performance
- Instruction-Level Parallelism and Dependency Chains
- CPU Microarchitectures in 2026 (x86, ARM Server, RISC-V Progress)
- Writing Code That Cooperates with the CPU
Chapter 4: Memory Systems, Caches, and Locality
- The Memory Hierarchy and Latency Wall
- Cache Architecture (L1, L2, L3, TLB)
- Spatial and Temporal Locality in Practice
- False Sharing and NUMA Awareness
- Data Structures Optimized for Cache Behavior
Chapter 5: Memory Allocation and Garbage Collection
- The Hidden Cost of malloc and new
- Custom Allocators (Arena, Pool, Slab)
- Garbage Collection in Java (G1, Shenandoah, ZGC)
- Go’s Garbage Collector and Allocation Patterns
- When to Use Each Memory Management Strategy
Chapter 6: Concurrency, Parallelism, and Asynchronous Programming
- Concurrency vs Parallelism: The Distinction That Matters
- Threads, Locks, and Contention
- Lock-Free and Wait-Free Data Structures
- Async/Await and Event Loop Architectures
- Choosing the Right Concurrency Model for Your Workload
Chapter 7: Operating System Performance: Scheduling, Syscalls, and I/O
- Linux Process Scheduling and CPU Affinity
- System Call Overhead and Alternatives
- I/O Multiplexing (epoll, kqueue, io_uring)
- Virtual Memory, Page Faults, and Memory Mapping
- Tuning the OS for Performance Workloads
Chapter 8: Filesystems and Storage Performance
- Storage Hardware in 2026 (NVMe, CXL Memory Expansion)
- Filesystem Performance Characteristics (ext4, XFS, btrfs, ZFS)
- Kernel Page Cache and Read-Ahead Behavior
- Distributed and Cloud Storage Trade-offs
- Storage Tuning for Different Workload Types
Chapter 9: Database Performance and Query Optimization
- How Databases Execute Queries (Planners, Optimizers)
- Indexing Strategies and Trade-offs
- PostgreSQL Performance Tuning in Practice
- Connection Pooling and Query Caching
- Distributed Database Performance Patterns
Chapter 10: Networking Performance and Protocols
- TCP Behavior and Its Performance Implications
- HTTP/2, HTTP/3, and QUIC in Production
- Serialization Formats: Protobuf, MessagePack, FlatBuffers
- Compression Trade-offs (CPU vs Bandwidth)
- Network-Aware Application Design
Chapter 11: Distributed Systems Performance
- Latency Amplification in Distributed Calls
- Consistency Models and Their Latency Costs
- Partitioning and Sharding for Performance
- Backpressure and Flow Control Patterns
- Designing for Tail Latency in Distributed Systems
Chapter 12: Compiler Optimizations and JIT Compilation
- How Compilers Optimize Your Code (LLVM Passes)
- Auto-Vectorization and SIMD
- Link-Time Optimization and Whole-Program Analysis
- JIT Compilation in JVM and V8
- Verifying Compiler Optimizations with Compiler Explorer
Chapter 13: Profiling Tools, Flame Graphs, and Performance Diagnosis
- Sampling Profilers vs Tracing Profilers
- Linux Performance Tools (perf, ftrace, bpftrace)
- Creating and Interpreting Flame Graphs
- Language-Specific Profilers (async-profiler, pprof, py-spy)
- Systematic Diagnosis from Profile Data
Chapter 14: Benchmarking Methodology and Load Testing
- Designing Valid Microbenchmarks
- Common Benchmarking Pitfalls and How to Avoid Them
- Load Testing Methodology (Ramp-up, Sustained, Spike)
- Statistical Significance in Performance Testing
- Tools: wrk, k6, JMH, Criterion
Chapter 15: Observability, Tracing, and Production Monitoring
- The Three Pillars: Metrics, Logs, Traces
- Distributed Tracing with OpenTelemetry
- Designing Performance Dashboards
- Alerting on Performance Degradation
- Diagnosing Production Incidents Systematically
Chapter 16: Cloud, Containers, and Kubernetes Performance
- Container Runtime Overhead and cgroups
- Kubernetes Resource Management (Requests, Limits, QoS Classes)
- Cloud Networking Performance Characteristics
- Serverless Cold Starts and Optimization Strategies
- Getting Predictable Performance on Shared Infrastructure
Chapter 17: End-to-End Case Studies
- Case Study 1: Optimizing a High-Throughput API Service (Go)
- Case Study 2: Database Query Performance Rescue (PostgreSQL)
- Case Study 3: Reducing Tail Latency in a Distributed System
- Case Study 4: Memory and GC Optimization in Java