Question about CPU caches and D context pointers

Dicebot public at dicebot.lv
Tue Feb 18 10:27:57 PST 2014


On Tuesday, 18 February 2014 at 18:13:24 UTC, Casper Færgemand 
wrote:
> S[2] s2; // array of two structs, plus a length?

Storing length is not needed for static arrays because it is 
known, well, statically.

> I tested some prime sieves both in C++ and D. They worked 
> fastest with dynamic arrays with a size matching the L1 cache. 
> I presume the instructions are located elsewhere in the CPU.

Yes, instruction cache is completely separated from data cache.


More information about the Digitalmars-d-learn mailing list