3 ms·
Shouldn’t you choose the random numbers such that array[idx1] ^ array[idx1 + 1] are guaranteed to fall in the same cache line? Assuming that it has that. Right
by lrossi 6y ago
Shouldn’t you choose the random numbers such that array[idx1] ^ array[idx1 + 1] are guaranteed to fall in the same cache line? Assuming that it has that. Right now some accesses cross the end of the cache line.
- CyberRabbi 6y agoTechnically you are correct but it’s expected to cross a cache line 1/16 times (or however many ints there are in a cache line). There is an implicit assumption that that is relatively infrequent enough that it shouldn’t increase the average time too much, but that assumption should be tested.