02Chapter 2: Cache lines: how data actually movesThis chapter assumes you know C or a similar language, how arrays and structs sit in memory, and the memory hierarchy from the previous chapter (registers, L1, L2, L3, main memory).2 min read
03Chapter 3: Spatial and temporal localityThis chapter assumes you know C or a similar language, arrays and structs, and the idea of a cache line (a 64-byte block that moves between memory and cache as one unit). Locality is the property that makes caches work. Code with good locality hits the cache often. Code with poor locality waits on m2 min read
04Chapter 4: Traversal order: row-major access and stridesThis chapter assumes you know C arrays and pointers, and that you have read the earlier chapters on cache lines and locality. A cache line is the fixed-size block (commonly 64 bytes) that moves between memory and cache.2 min read
05Chapter 5: Arrays versus linked structuresThis chapter assumes you know how a cache line moves data (64 bytes is common) and what spatial locality means. It also assumes you can read C and know how arrays, linked lists and pointers work.2 min read
06Chapter 6: Compulsory, capacity, and conflict missesThis chapter assumes you know what a cache line is and how spatial and temporal locality work. It also assumes you can read basic C. A cache miss happens when the CPU asks for data that is not in the cache. Not all misses have the same cause, and the cause tells you which fix to try.2 min read
07Chapter 7: Alignment, padding, and field orderThis chapter assumes you can read C structs and pointers, and that you know a cache line is the unit of transfer between memory and the CPU (about 64 bytes on common x86-64 and ARM parts, though not guaranteed).2 min read
08Chapter 8: Array of structs versus struct of arraysThis chapter assumes you know C structs and pointers, and that you have read the earlier chapters on cache lines, spatial locality, and padding. A cache line is the 64-byte block (a common size, not a guaranteed one) that the CPU loads from memory in one transfer.2 min read
09Chapter 9: Splitting hot and cold dataThis chapter assumes you know cache lines, struct padding, and the array-of-structs versus struct-of-arrays trade-off from earlier chapters. It also assumes you can read C.2 min read
11Chapter 11: Measuring cache behavior without fooling yourselfThis chapter assumes you can read C and C++, know what a cache line is, and have seen the row-major versus column-major example from earlier chapters. Here you learn how to measure cache effects and avoid the usual traps.2 min read
13Chapter 13: Blocking (tiling) for matrix-style loopsThis chapter assumes you know that a cache line is the unit of transfer, and that you have seen row-major traversal and strides. You should also be comfortable with nested loops over 2D data stored in a flat array.2 min read
15Chapter 15: Wide-node trees: why B-trees beat binary trees in memoryThis chapter assumes you know binary search trees, Big-O notation, and the cache-line idea from earlier chapters: memory moves in blocks of about 64 bytes, and pointer chasing forces a separate load for each node.2 min read
16Chapter 16: False sharing between threadsThis chapter assumes you know what a cache line is, how threads and atomics work in C++, and that cores keep private caches. Cache lines are usually 64 bytes, though that size is common rather than guaranteed.2 min read
17Chapter 17: TLB misses and page-level localityThis chapter assumes you know cache lines, spatial locality, and traversal order from the earlier chapters. You should also know that programs use virtual addresses.2 min read
18Chapter 18: Cache-oblivious algorithms and layoutsThis chapter assumes you know cache lines, spatial and temporal locality, and blocking (tiling) for nested loops. It also assumes you have seen B-trees and the idea of wide nodes. Here you will see how to get good cache behavior without hard-coding the cache size.2 min read