This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Data-oriented design" – news ·newspapers ·books ·scholar ·JSTOR(July 2020) (Learn how and when to remove this message) |
Incomputing,data-oriented design is aprogram optimization approach motivated by efficient usage of theCPU cache, often used invideo game development.[1] The approach is to focus on the data layout, separating and sortingfields according to when they are needed, and to think about transformations of data. Proponents include Mike Acton,[2]Scott Meyers,[3] andJonathan Blow.
Theparallel array (orstructure of arrays) is the main example of data-oriented design. It is contrasted with thearray of structures typical of object-oriented designs.
The definition of data-oriented design as aprogramming paradigm can be seen as contentious as many believe that it can be used side by side with another paradigm,[4] but due to the emphasis on data layout, it is also incompatible with most other paradigms.[1]
These methods became especially popular in the mid to late 2000s during theseventh generation of video game consoles that included theIBMPowerPC basedPlayStation 3 (PS3) andXbox 360 consoles. Historically,game consoles often have relatively weakcentral processing units (CPUs) compared to the top-of-line desktop computer counterparts. This is a design choice to devote more power andtransistor budget to thegraphics processing units (GPUs). For example, the 7th generation CPUs were not manufactured with modernout-of-order execution processors, but instead usein-order processors with high clock speeds and deeppipelines. In addition, most types of computing systems havemain memory located hundreds ofclock cycles away from theprocessing elements. Furthermore, as CPUs have become faster alongside a large increase in main memory capacity, there is massive data consumption that increases the likelihood ofcache misses in theshared bus, otherwise known asVon Neumann bottlenecking. Consequently,locality of reference methods have been used to control performance, requiring improvement ofmemory access patterns to fix bottlenecking. Some of the software issues were also similar to those encountered on theItanium, requiringloop unrolling for upfront scheduling.
This sectionmay containoriginal research. Pleaseimprove it byverifying the claims made and addinginline citations. Statements consisting only of original research should be removed.(September 2021) (Learn how and when to remove this message) |
The claim is that traditionalobject-oriented programming (OOP) design principles result in poor data locality,[5][6] more so if runtime polymorphism (dynamic dispatch) is used (which is especially problematic on some processors).[7][1] Although OOP appears to "organise code around data", it actually organisessource code arounddata types rather than physically grouping individual fields and arrays in an efficient format for access by specific functions. Moreover, it often hides layout details underabstraction layers, while a data-oriented programmer wants to consider this first and foremost.