3 ms·
It is due to CPU cache issues, but not because the cache is full. CPU caches are indexed on the low bits of the address. If you have two addresses with the sam
by jbri 15y ago
It is due to CPU cache issues, but not because the cache is full.
CPU caches are indexed on the low bits of the address. If you have two addresses with the same low-order bits, then those addresses will collide in the cache, even though the cache isn't full.
Large allocations (e.g. huge arrays) tend to get their own memory pages allocated - which means that the same offset in two different arrays ends up having the same low-order bits.