Contiguous Memory Layout: CPU Cache's Best Friend

NumPy's `ndarray` stores homogeneous data in a single, continuous block of memory, which significantly improves CPU cache utilization (locality of reference) and enables faster data access compared to Python lists that store scattered pointers to objects. [1, 2, 6]

Sources

Open the full topic