Skip to main content
gamedev.net
🔒 Locked

Pre-caching data

Started by Danack 0 replies 950+ views
Original Post
Danack
Danack
I''ve got a loop that is taking up a fair whack of processor time, and I wanted to look at optimising it. After looking at it in Vtune, I could see that the most time was spent getting data from main memory, as it misses both caches. The loop basically goes through an array of structures, updates the data in them, saves them back out to memory and renders a couple of triangles for each one. I thought I could just read in a peice of data from the structure that I am going to use in the next loop without doing anything to it and this would get the data into the cache without stalling. However the processor always seems to stall. Does anyone know how to touch data to get it into the cache without stalling the processor in the meantime ? cheers dan The way I was going to try next was to just to copy the data from memory to some junk place. Although this would stall the CPU, it would do all of the accesses in one go, and so would prevent multiple stalls. Game production: Good, quick, cheap: Choose two.
Game production:Good, quick, cheap: Choose two.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.