Data-oriented design

This is an old revision of this page, as edited by Fmadd (talk | contribs) at 16:55, 12 June 2016 (Other languages). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In computing, Data oriented design (not to be confused with data-driven design) is a software optimisation approach motivated by cache coherency, used in video game development (usually in the C or C++ programming languages. The approach is to focus on the data layout, separating and sorting fields according to when they are needed, and to think about transformations of data.

Proponents include Mike Acton.

Motivation

These techniques became especially popular during the PS3 and xbox 360 console generation when the hazards of cache misses became pronounced due to their use of in-order processors and high clock speeds.[1]. In modern systems (even with out of order execution, main memory is as many as hundreds of clock cycles away from the processing elements, consequently locality of reference issues dominate performance.

Contrast with OOP

The claim is that traditional object-oriented design principles result in poor data locality, especially if runtime polymorphism is used (which itself is especially problematic on certain processors). Although OOP does on the surface seem to 'organise code around data', the practice is quite different. OOP is actually about organising source code around data types, rather than making the layout of individual fields and arrays convenient for specific functions. It also frequently hides layout details under abstraction layers, whilst a data-oriented programmer wants to think about this first and foremost.

Other languages

The experimental JAI programming language being developed by Jonathan Blow has explicit support for data oriented design, whilst eschewing the traditional OOP paradigm. This is facilitated by being able to transparently move fields between objects without extensive source code changes to functions using them, and adding direct support for SoA data layout.


See also

  1. ^ "data oriented design" (PDF).