Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Data Oriented programming? [closed]

Tags:

Can any one explain to me

  1. what is Data Oriented programming?
  2. Is Data oriented programming and functional programming the same?
  3. How is Data Oriented programming different from Object Oriented programming?
  4. Under what circumstances do we choose Data Oriented programming languages over Object Oriented programming languages?
like image 957
wizzardz Avatar asked Nov 08 '10 09:11

wizzardz


1 Answers

First I want to say, that Data-oriented design and Data-driven programming is not the same!

In object-oriented programming you are focusing on a single object (class - its methods, members, etc.). In data-oriented design you are thinking how data is touched and processed. You just have a box that processes your input data to your output data (the ideal input data is the same as output).

All this was created to write high-performance applications. You are working on homogeneous, linear data - all to take the full advantage of CPU cache (both instruction and data).

Whenever you can, try to avoid hierarchical structures (use arrays instead), try to write functions that works on multiple data and use hot and cold structure splitting.

int Foo(int* input_data, int count) {     // do something with your data } 
like image 132
mani3xis Avatar answered Sep 17 '22 10:09

mani3xis