Vector of Objects vs Vector of Pointers Updated -- Bartlomiej Filipek

More in the "contiguous enables fast" department:

Vector of Objects vs Vector of Pointers Updated

by Bartlomiej Filipek

From the article:

For 1000 particles we need on the average 2000 cache line reads! This is 78% more cache line reads than the first case! Additionally Hardware Prefetcher cannot figure out the pattern -- it is random -- so there will be a lot of cache misses and stalls.

In our experiment the pointer code for 80k of particles was more 266% slower than the continuous case.

Add a Comment

Comments are closed.

Comments (1)

0 0

Veritas said on May 31, 2014 09:40 AM:

Does performance improve for the pointer case if the pointed-to objects are stored contiguously ?