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.
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