As I understand it, memory pools should improve cache performance for objects commonly accessed together, if the objects are smaller than the cache line size – because then adjacent objects will likely be fetched into the cache at the same time.
But what about objects larger than the cache line size? Is there any benefit to pooling such data into the same region of memory?
(Assuming that allocation/deallocation times are insignificant, it’s access I’m worried about…)
Thanks!
Memory pooling makes sense if your app uses a huge amount of memory and starts to swap. Then, if the objects lie adjacent to each other, they will be paged in and out together.