Skip to content

Data Oriented Design (DOD) vs. Object Oriented Design (OOD) in action with performance stats.

Notifications You must be signed in to change notification settings

jeuxdemains/DataOriented_vs_ObjectOriented

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Oriented Programming vs Object Oriented Programming

A simple Data Oriented Design (DOD) vs. Object Oriented Design (OOD) demo example with performance stats for the performance oriented coders out there.

OOP is meant for the people. To express their ideas and thoughts and abstract them in more human-friendly way. Computers however, don't like objects. They like well structured data.

Here is a small example of the two paradigms in the context of performace. It uses multithreading and local machine instruction set level optimizations for maximum performance gains.

Notes on compilation

The build system uses clang++ but you can change it in the Makefile.
It uses OpenMP to perform multithreading. Read the comments in the code for more info on how to tweak it and to what degree.
Note that we restrict the compiler optimizations with the -O0 flag so it doesn't mess with the code and you can observe the actual difference.

Build: make
Run: make run
Run static analysis: make analyze
Clean: make clean

Here are some metrics:

Screenshot 2023-02-06 011712

What is the idea behind DOD

Screenshot 2023-02-06 013648

About

Data Oriented Design (DOD) vs. Object Oriented Design (OOD) in action with performance stats.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published