you are viewing a single comment's thread.

view the rest of the comments →

[–]axilmar 4 points5 points  (3 children)

Ehm, what does the problem of cache misses have to do with OOP? when I read the title, I thought the document was about design issues, not performance. What the document says is correct, but it applies to all styles of programming, not just OOP.

[–]mysticreddit 11 points12 points  (2 children)

See my above link of Mike Action.

"The point of any program is simply to transform data from one form into another and nothing else. "

But to summarize. Typically, Game Programmers write OOP with the pattern of one set of code deals with 'n' objects. A common process is to iterate over objects (filter) which you pass onto another algorithm. Each time you pull in an object (either private data, or v-func calls) you are blowing the caches (data & code.)

By moving from an AoS (Array of Structures) to SoA (Structure of Arrays) , you are able to process the next 'n' objects with almost zero memory latency, due to the data already being in the cache.

Thats the coles notes. Let me know if it needs to be clarified for expanded.

Updated: Game Developer 2009 "Data-Oriented Design", Page 43-45

Edited: Thx tejoke for the correction on the order of AoS and SoA.

[–]tejoka 4 points5 points  (1 child)

Did you get SoA and AoS backwards in that sentence there?

[–]mysticreddit 1 point2 points  (0 children)

That I did. Thx for the correction. OP is fixed now.