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: / iced_coffee_dev Github: https://github.com/simondevyoutube/ 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 Array operations, what's fast and what isn't Closing thoughts, why this is important to understand, how this relates to more advanced data structures

Why Linked Lists vs Arrays isn’t a real choice

Data Structures, Explained Simply

The Cost of Concurrency Coordination with Jon Gjengset

Ep 073: Introduction to Cache Memory

C++ cache locality and branch predictability

When Optimisations Work, But for the Wrong Reasons

This Is Why Everyone Is Angry About AI

How I Optimized My JavaScript Project (Complete Walkthrough) | Faster Spatial Hash Grids

How CPU Memory & Caches Work - Computerphile

I Hacked This Temu Router. What I Found Should Be Illegal.

Faster than Rust and C++: the PERFECT hash table

Object Oriented Programming vs Functional Programming

Something is jamming GPS over Europe. Here's what we found

How Cache Works Inside a CPU

Most Optimization Advice Misses the REAL Problem

Turing Award Winner: Disagreeing with Google, Postgres, Future Problems | Mike Stonebraker

How Slow is JavaScript Really? JavaScript vs C++ (Data Structures & Optimization)

This Algorithm is 1,606,240% FASTER

Every Data Structure Simply Explained in 25 Minutes!

