Memory, Cache Locality, and why Arrays are Fast ( Data Structures and Optimization)
Why is the first loop 10x faster than the second, despite doing the exact same work Follow me on: Twitter: Github: In this video we talk a bit about memory, the cpu caches (specifically the L1, L2, L3 cache), hardware prefetching, and how all this comes together for arrays. We ll be covering each of these topics in enough detail for you to get a solid understanding, working through real world examples to help illustrate the point. We ll talk about the most fundamental data structure, arrays, how they work, what situations they re great in, and when they suck. We ll also touch on some algorithmic complexity. Finally, we ll be talking about why understanding this is important and how this leads in to more advanced topics and data structures. What s covered: How memory allocation works, memory addresses Contiguous memory CPU Caches, L1, L2, L3 cache Hardware prefetching
|