4 ms·
Most modern architectureshavs prefetch instructions. I'm not surprised compilers don't have this (they optimise for the average program), but I am surprised tha
by gcc_programmer 10y ago
Most modern architectureshavs prefetch instructions. I'm not surprised compilers don't have this (they optimise for the average program), but I am surprised that specialised libraries like Boost aren't doing this.
- wsxcde 10y agoPrefetch instructions are difficult to get right from a compiler perspective. If you prefetch too early, you might kick useful data out of the cache. If you do it too late, it's obviously useless, plus you just wasted an entire instruction: I-cache space, one fetch slot, one issue slot, one ROB entry, etc. Plus, they're not portable, even if you get the timing right now, it won't work on the next generation of the microprocessor or on a slightly different memory subsystem. You might be able to tune it just right on your desktop, but it probably won't work as well on your laptop, and it certainly won't work as well on a cluster. IMO prefetch instructions are a useful hack when you have a very specific machine on which you're hand-tuning assembly to get the most performance. There aren't too many scenarios where this is useful - maybe scientific workloads on huge supercomputers are one - but they're otherwise kinda useless.
- abc_lisper 10y ago> Plus, they're not portable, even if you get the timing right now, it won't work on the next generation of the microprocessor or on a slightly different memory subsystem. You might be able to tune it just right on your desktop, but it probably won't work as well on your laptop, and it certainly won't work as well on a cluster I think using Java or any other JIT system will solve this problem.