Data Oriented Design과 Cache Miss
Data Oriented Design (DOD)는 Object-Oriented Design(OOD)와 다른 편에 서 있는 Language Design 개념이다. 말그대로 객체 지향이 아닌, 데이터 지향적인 프로그래밍 설계 방법이다. 대게 OOD에서는 몬스터 클래스를 만들면 아래와 같이 설계한다.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
class Monster { Vector3 power; Vector3 velocity; Vector3 position; Quaternion rotation; void render(); }; vector<Monster> monsterList; |
그런데 DOD에서는 아래와 같이 한다.
1 2 3 4 5 6 7 8 9 10 11 |
class MonsterGroup { vector<Vector3> power; vector<Vector3> velocity; vector<Vector3> position; vector<Quaternion> rotation; void render(); }; |
즉, monster의 객체를 따로 정의하고 생성된 몬스터를 리스트에 집어 넣어서 객체별로 따로 움직임을 주는 것이 아닌, 몬스터의 객체를 […]