5 ms·
Side-question: is there a way to write code to be sure my code and data is stored in L3 cache? I understand it's done automatically from RAM, but what if I want
by deepsun 5y ago
Side-question: is there a way to write code to be sure my code and data is stored in L3 cache? I understand it's done automatically from RAM, but what if I want to hack it out so that it's guaranteed to be in cache? What about L2 cache?
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- aidenn0 5y agoIntel had extensions to let you encourage that to happen CAT and CDP. However they require OS support. It's a common feature on embedded processors, where portability is less of a concern.
- spixy 5y agoYes, kind of. It is called Data-oriented design: https://en.wikipedia.org/wiki/Data-oriented_design https://en.wikipedia.org/wiki/Data-oriented_design
- Sammi 5y agoSeems related to Entity Component Systems.
- VHRanger 5y agoMake the next piece of data you touch after an operation close to the one your touching (statistically, on average). The introduction talk to this is by Mike Acton at cppcon, but Jon Blow has been harping on about it as well
- deepsun 5y agoYes, but I want it to be guaranteed, not statistically. E.g. I want to run Quake1 right from the L3 cache. E.g. with filesystem I'm sure when I read or write it, if I use regular IO operations, no mmap-ing (of course there's a lot of quirks with drive caches not respecting fsync, etc, but let's skip that for sake of this comment).