Understanding, Analyzing, Measuring and Optimizing Computing Systems
Introduction: Why Architecture Matters
Chapter 1: The Architecture of Performance
- The Emergence of Performance
- Why Architecture Matters for Software Engineers
- The Performance Engineering Mindset
- A Working Example: Tracing a Slow Query Through the Stack
- The Cost Model of Computing
- How to Use This Book
Chapter 2: Historical Foundations of Computer Architecture
- From Vacuum Tubes to Integrated Circuits
- The Von Neumann Architecture and Its Variants
- The Rise of the Microprocessor: Intel 4004 to 8086
- The RISC Revolution
- The Superscalar Era
- The Multicore Transition
- Architectural Continuity and Change
Chapter 3: Binary Representation and Digital Logic
- Bits, Words and Number Representations
- Boolean Algebra and Logic Gates
- Combinational and Sequential Logic
- Flip-Flops, Registers and State Machines
- Timing, Clock Domains and Setup/Hold Constraints
- CMOS Technology and Switching Costs
- The Clock: The Heartbeat of Synchronous Design
Chapter 4: Instruction Set Architectures
- What Is an Instruction Set Architecture
- CISC and RISC: Philosophy and Reality
- The x86-64 Architecture
- The ARM Architecture Family
- The RISC-V Instruction Set
- ISAs in Practice: Performance Implications
- Choosing an Architecture for Your Workload
Chapter 5: The CPU Microarchitecture
- The Instruction Pipeline
- Superscalar Execution and Execution Ports
- Micro-Operations and Translation
- Register Renaming and Physical Registers
- Out-of-Order Execution
- The Reorder Buffer and Commit Logic
- Execution Efficiency and IPC Limits
Chapter 6: Speculation and Branch Prediction
- The Cost of Conditional Branches
- Static and Dynamic Branch Prediction
- Branch Target Buffers and Return Stack Buffers
- Speculative Execution and Its Risks
- Security Implications: Spectre, Meltdown and Mitigations
- Branch Optimization in Software
- Measuring Branch Behavior
Chapter 7: Instruction Scheduling and Parallelism
- Data Dependencies and True Hazards
- Anti-Dependencies and Output Dependencies
- Tomasulo’s Algorithm
- Reservation Stations and Load/Store Queues
- Compiler Scheduling and Software Pipelining
- Exposing Instruction-Level Parallelism
- When ILP Runs Out
Chapter 8: Cache Hierarchies
- The Locality Principle
- Cache Organization: Sets, Ways, Lines
- Hit, Miss and the Miss Penalty
- Replacement Policies
- Write Policies and Cache Coherence Basics
- Cache Thrashing and Conflict Misses
- Prefetching Mechanisms
Chapter 9: Cache Optimization for Software
- Analyzing Cache Behavior
- Data-Oriented Design
- Memory Layout and Structure of Arrays vs Array of Structures
- Padding, Alignment and False Sharing
- Loop Transformations for Cache Efficiency
- Practical Cache Optimization Case Studies
- Measuring Cache Performance
Chapter 10: The Memory Subsystem
- DRAM Technology and Organization
- Memory Controllers and Channels
- Bandwidth, Latency and Access Timing
- Virtual Memory and Address Translation
- Page Tables and Translation Lookaside Buffers
- Huge Pages and Performance
- NUMA Architecture and Programming
- Memory Allocation Patterns
Chapter 11: System Interconnects and I/O Architecture
- Buses and Point-to-Point Interconnects
- PCIe Architecture and Generations
- CXL and Coherent Accelerators
- Chiplets and Advanced Packaging
- System-on-Chip Architectures
- The Memory-Mapped I/O Paradigm
- I/O Bottlenecks and Architectural Responses
Chapter 12: SIMD and Vector Processing
- The SIMD Model
- x86 SIMD Evolution: SSE, AVX, AVX-512
- ARM NEON and SVE/SVE2
- Vectorization: Automatic and Manual
- Data Alignment and Vector Masks
- Vectorization Performance Case Studies
- When Vectorization Helps or Hurts
Chapter 13: GPUs and Parallel Processing Architectures
- The GPU Execution Model
- SIMT Architecture and Warp Scheduling
- GPU Memory Hierarchies
- Occupancy and Performance
- CPU vs GPU: Choosing the Right Accelerator
- Programming for GPUs: Data Movement and Kernels
- Practical GPU Optimization
Chapter 14: Specialized Accelerators and Domain-Specific Architectures
- Why Specialized Hardware
- Tensor Processing Units and AI Accelerators
- Neural Processing Units
- FPGAs for Custom Computing
- Domain-Specific Architectures
- The Economics of Custom Silicon
- Accelerators in the Data Center
Chapter 15: Concurrency and Multicore Design
- Hardware Multithreading: SMT and HPC
- Memory Consistency Models
- Atomic Operations and Hardware Support
- Cache Coherence Protocols
- Synchronization Primitives and Their Costs
- Lock-Free and Wait-Free Algorithms
- False Sharing and Data Contention
Chapter 16: Parallel Programming and Scalability
- Amdahl’s Law and Its Implications
- Gustafson’s Law and Scalability
- Thread-Level Parallelism
- Work Partitioning Strategies
- Communication and Synchronization Overheads
- Measuring and Diagnosing Parallel Performance
- Scaling to Many Cores
Chapter 17: Storage and Persistent Memory
- NAND Flash and SSD Architecture
- SSD Internal Mechanics: GC, Wear Leveling, Endurance
- NVMe Protocol and Queue Architecture
- Storage Latency and Throughput Characteristics
- Persistent Memory Technologies
- I/O Optimization in Software
- Storage Tiering and Hybrid Architectures
Chapter 18: Power, Thermal Design and Performance-per-Watt
- Dynamic and Static Power in CMOS
- DVFS and Frequency Scaling
- Turbo Boost Technologies
- Thermal Design and Throttling
- Energy-Proportional Computing
- Optimizing for Performance-per-Watt
- Power Management in Software
Chapter 19: Performance Measurement and Analysis
- The Performance Engineering Methodology
- Latency, Throughput and Their Tradeoffs
- Establishing Baselines and Targets
- Designing Meaningful Benchmarks
- Linux perf and Performance Counters
- Intel VTune and AMD uProf
- PAPI, PCM and eBPF
- Flame Graphs and Visualization
- Interpreting Hardware Performance Counters
Chapter 20: Advanced Performance Analysis
- Sampling vs Tracing vs Instrumentation
- Microbenchmarking Frameworks
- Statistical Rigor in Performance Measurement
- Avoiding Measurement Pitfalls
- Compiler Optimization Reports and Assembly Analysis
- Memory Access Pattern Analysis
- System-Wide Profiling
- Case Study: Full-Stack Performance Investigation
Chapter 21: Optimization Techniques and Transformations
- The Optimization Hierarchy: Where to Look First
- Algorithmic and Complexity Improvements
- Data Structure and Layout Optimizations
- Loop Transformations and Tiling
- Prefetching and Data Movement
- Branch Optimization
- Inlining, Unrolling and Code Motion
- Compiler Flags and Optimization Levels
- Case Studies: Real Optimization Journeys
Chapter 22: Modern Architectural Trends
- Advanced Packaging: 2.5D, 3D Stacking, Interposers
- High-Bandwidth Memory and Stackable DRAM
- Chiplet-Based System Design
- Confidential Computing and Trusted Execution Environments
- Hardware Virtualization Extensions
- Cloud and Hyperscale Architectures
- Exascale and Post-Exascale Computing
- Sustainable and Carbon-Aware Computing
Chapter 23: Synthesis and Practice
- Building a Mental Model of the Machine
- The Performance Engineer’s Decision Process
- Architecture and Software Co-Design
- When to Optimize and When to Accept
- Staying Current in a Fast-Moving Field
- Final Thoughts on Performance and Architecture
