4 ms·
Nice. I am sure this can be extended to object graphs too. Now, if only we(or the compiler) has a way of hinting to the cpu how to prefetch the objects, it wou
by abc_lisper 10y ago
Nice. I am sure this can be extended to object graphs too.
Now, if only we(or the compiler) has a way of hinting to the cpu how to prefetch the objects, it would give us awesome performance.
- gcc_programmer 10y agoMost 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.