Thread: prefetching

  1. #1
    3735928559
    Join Date
    Mar 2008
    Location
    RTP
    Posts
    838

    prefetching

    can anyone direct me to a good reference for this? i haven't been able to google up anything really useful. when i prefetch the data to be processed in future iterations, i get no improvement. i can't tell if the vs optimizer is brewing in prefetches, or if i am just not doing it right. this isn't something i know a lot about, so some more illustrative/didactic reading material would be really helpful.

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    The CPU is pretty good at predicting prefetches on its own. You only need explicit prefetch when the CPU gets it wrong a lot.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  3. #3
    3735928559
    Join Date
    Mar 2008
    Location
    RTP
    Posts
    838
    that was the conclusion i was coming to, especially since i am essentially always doing sequential access. the best i was able to do was not make it worse.

    i did find this, however:

    http://lwn.net/Articles/255364/
    Last edited by m37h0d; 07-01-2011 at 12:33 PM.

Popular pages Recent additions subscribe to a feed