Computer Architecture Through Code: Understand CPUs, Caches, Memory, Instructions, and Performance
Halstead, Corin
Synopsis "Computer Architecture Through Code: Understand CPUs, Caches, Memory, Instructions, and Performance"
What really happens after your code leaves the editor—and why can software that looks efficient on screen perform poorly on real hardware? Computer Architecture Through Code bridges the gap between software and silicon by starting where programmers actually work: with code. Instead of treating computer architecture as a collection of processor diagrams, specifications, and hardware trivia, Corin Halstead follows small, measurable programs downward to reveal what the machine is really doing. Discover how source code becomes machine instructions, how modern processors exploit parallelism, and why data movement through caches, DRAM, virtual memory, NUMA, and I/O often determines real-world speed. Learn to reason about pipelines, superscalar and out-of-order execution, branch prediction, registers, SIMD and vectorization, cache locality, address translation, multicore coherence, false sharing, synchronization, and hardware performance counters. The book also explores GPUs, NPUs, DMA, PCI Express, coherent interconnects, security, heterogeneous computing, and modern processor architectures—while showing how to compare x86-64, Arm, and RISC-V systems without relying on brand slogans or memorized specifications. More importantly, you will learn a repeatable engineering method for diagnosing performance: measure, model, change, and validate. Rather than guessing why software is slow, you will learn how to identify the limiting resource, collect meaningful evidence, test a hypothesis, and make changes that improve the workload that actually matters. Hands-on architecture labs, troubleshooting tables, practical experiments, performance equations, mental models, a glossary, recommended resources, and a structured further-learning path help turn theory into usable engineering skill. No electrical engineering background is required. If you understand basic programming and want to know what CPUs, compilers, memory systems, and accelerators are really doing beneath your software, this book provides a practical path from code to silicon.