In an Intel-sponsored reprint
of a Game Developer magazine article from September 2010, game industry coder and veteran Noel Llopis takes a closer look at Data-Oriented Design.
Llopis notes that, by reorganizing the entity update function, it's possible to "significantly improve performance and parallelization".
"By removing the ray cast calls from within the entity update function, we've shortened the call tree significantly," he explains. "The functions are more self-contained, easier to understand, and probably much more efficient because of better cache utilization."
"You can also see how it would be a lot easier to parallelize things now by sending all ray casts to one core while another core is busy updating something unrelated (or maybe by spreading all ray casts across multiple cores, depending on your level of granularity)."
However, Llopis points out that, "If this is the only change we make to the entity update, and the rest of the code is the usual deep tree-traversal code, we might not have gained much because we're still blowing the cache limits with every update."
He suggests that modifying the data to fit the way it's being used is the key to boosting the performance. "After seeing how the entity is updated in two separate passes," he says, "you might notice that only some of the data that was stored in the entity object is touched on the first update, while the second pass accesses more specific data."
"At that point we can split up the entity class into two different sets of data. Then the most difficult task is to name these sets of data in some meaningful way. They're not representing real objects or real-world concepts anymore, but different aspects of a concept, broken down purely by how the data is processed."
The sponsored feature is live now on Gamasutra
, and goes into more depth regarding ways to improve performance for Data-Oriented Design.