2 ms·
> it's still fairly safe to assume that arrays are going to end up in relatively contiguous memory A contiguous array of pointers to the actual objects doesn't
by munificent 3y ago
> it's still fairly safe to assume that arrays are going to end up in relatively contiguous memory
A contiguous array of pointers to the actual objects doesn't buy you much. You're still doing an indirection and risking blowing your cache each time you do something with each element. It may be the case that the objects the array elements point to are contiguous in memory, but that's entirely a roll of the dice, and those dice get re-rolled on every garbage collection.