Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Prozak

Avoiding cache misses

This topic is 5223 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Use temporal and spatial locality in your data, reduce the generated code size, use smaller data structures and pay attention to your profiler.

For more complete answers, you might want to check out the book Small Memory Software, or any basic book on computer architecture geared towards computer science majors.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It''s not uncommon that compiling with "optimize for size" results in better performance that "optimize for speed", mainly because of better cache usage.

Single cache misses isn''t too bad, ~8-10 cycles for L1 miss and ~40-50 for L2 miss. In addition, the CPU/chipset prefetching can sometimes lower those figures.

Having several threads doing work on a single CPU will likely result in burning caches if all threads'' local data can''t be held in the cache. So keeping thread count low is a good idea. For most games that''s probably not an issue though, but for a server side application it''s a real-world problem.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!