prefetching

This is a discussion on prefetching within the C++ Programming forums, part of the General Programming Boards category; can anyone direct me to a good reference for this? i haven't been able to google up anything really useful. ...

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

    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
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,239
    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
    839
    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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21