Objects vs. the L2 Cache

An excellent little performance optimization presentation that shows how important memory layout is for today's processors:

http://research.scee.net/files/presentations/gcapaustralia09/Pitfalls_of_Object_Oriented_Programming_GCAP_09.pdf

The beginning of the talk makes the observation that since C++ was started in 1979 the cost of accessing uncached main memory has ballooned from 1 cycle to 400 cycles.

The bulk of the presentation shows the optimization of a graphics hierarchy library, where switching from a traditional OO design to a structure-of-arrays design makes the code run 3 times faster. (Because of better cache access patterns.)

Comments

Alan Mimms said…
Hi Jack, remember me from Apple?

I found this very interesting. It didn't have a lot that was NEW, per se, but it was all in one place and well presented. I am doing high performance networking stuff at work, and high performance Android game development at home.

It's nice to see you're still as energetic as ever!

Popular posts from this blog

GLES Quake - a port of Quake to the Android platform

Using a Mac keyboard with Ubuntu Linux

A Taipei-Torrent postmortem: Writing a BitTorrent client in Go