www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Cache prefetching

reply "bearophile" <bearophileHUGS lycos.com> writes:
A simple article that shows a nice usage of __builtin_prefetch:

http://www.naftaliharris.com/blog/2x-speedup-with-one-line-of-code/

Bye,
bearophile
Nov 14 2013
parent Marco Leise <Marco.Leise gmx.de> writes:
Am Fri, 15 Nov 2013 00:31:40 +0100
schrieb "bearophile" <bearophileHUGS lycos.com>:

 A simple article that shows a nice usage of __builtin_prefetch:
 
 http://www.naftaliharris.com/blog/2x-speedup-with-one-line-of-code/
 
 Bye,
 bearophile
Whenever I try that it doesn't seem to do anything :-( Good to see that others have more luck. And always remember that x86 has multiple prefetchers that detect sequential memory access in either direction. So in theory you only need manual prefetching if you have random access and still have some CPU cycles to fill with calculations on the current data before you need the next block. -- Marco
Nov 14 2013