SlideShare a Scribd company logo
1 of 201
Data-Oriented Design and 
C++ 
Mike Acton 
Engine Director, Insomniac Games 
@mike_acton
A bit of background…
What does an “Engine” team do?
Runtime systems 
e.g. 
• Rendering 
• Animation and gestures 
• Streaming 
• Cinematics 
• VFX 
• Post-FX 
• Navigation 
• Localization 
• …many, many more!
Development tools 
e.g. 
• Level creation 
• Lighting 
• Material editing 
• VFX creation 
• Animation/state machine editing 
• Visual scripting 
• Scene painting 
• Cinematics creation 
• …many, many more!
What’s important to us?
What’s important to us? 
• Hard deadlines
What’s important to us? 
• Hard deadlines 
• Soft realtime performance requirements (Soft=33ms)
What’s important to us? 
• Hard deadlines 
• Soft realtime performance requirements (Soft=33ms) 
• Usability
What’s important to us? 
• Hard deadlines 
• Soft realtime performance requirements (Soft=33ms) 
• Usability 
• Performance
What’s important to us? 
• Hard deadlines 
• Soft realtime performance requirements (Soft=33ms) 
• Usability 
• Performance 
• Maintenance
What’s important to us? 
• Hard deadlines 
• Soft realtime performance requirements (Soft=33ms) 
• Usability 
• Performance 
• Maintenance 
• Debugability
What languages do we use…?
What languages do we use…? 
• C 
• C++ 
• Asm 
• Perl 
• Javascript 
• C#
What languages do we use…? 
• C 
• C++  ~70% 
• Asm 
• Perl 
• Javascript 
• C#
What languages do we use…? 
• C 
• C++  ~70% 
• Asm 
• Perl 
• Javascript 
• C# 
• Pixel shaders, vertex shaders, geometry shaders, compute shaders, …
We don’t make games for Mars but…
How are games like the Mars rovers?
How are games like the Mars rovers? 
•Exceptions
How are games like the Mars rovers? 
•Exceptions 
•Templates
How are games like the Mars rovers? 
•Exceptions 
•Templates 
• Iostream
How are games like the Mars rovers? 
•Exceptions 
•Templates 
• Iostream 
• Multiple inheritance
How are games like the Mars rovers? 
•Exceptions 
•Templates 
• Iostream 
• Multiple inheritance 
•Operator overloading
How are games like the Mars rovers? 
•Exceptions 
•Templates 
• Iostream 
• Multiple inheritance 
•Operator overloading 
•RTTI
How are games like the Mars rovers? 
•No STL
How are games like the Mars rovers? 
•No STL 
•Custom allocators (lots)
How are games like the Mars rovers? 
•No STL 
•Custom allocators (lots) 
•Custom debugging tools
Is data-oriented even a thing…?
Data-Oriented Design Principles 
The purpose of all programs, 
and all parts of those 
programs, is to transform 
data from one form to 
another.
Data-Oriented Design Principles 
If you don’t understand the 
data you don’t understand 
the problem.
Data-Oriented Design Principles 
Conversely, understand the 
problem by understanding 
the data.
Data-Oriented Design Principles 
Different problems require 
different solutions.
Data-Oriented Design Principles 
If you have different data, 
you have a different 
problem.
Data-Oriented Design Principles 
If you don’t understand the 
cost of solving the problem, 
you don’t understand the 
problem.
Data-Oriented Design Principles 
If you don’t understand the 
hardware, you can’t reason 
about the cost of solving the 
problem.
Data-Oriented Design Principles 
Everything is a data 
problem. Including usability, 
maintenance, debug-ability, 
etc. Everything.
Data-Oriented Design Principles 
Solving problems you 
probably don’t have creates 
more problems you 
definitely do.
Data-Oriented Design Principles 
Latency and throughput are 
only the same in sequential 
systems.
Data-Oriented Design Principles 
Latency and throughput are 
only the same in sequential 
systems.
Data-Oriented Design Principles 
Rule of thumb: Where there 
is one, there are many. Try 
looking on the time axis.
Data-Oriented Design Principles 
Rule of thumb: The more 
context you have, the better 
you can make the solution. 
Don’t throw away data you 
need.
Data-Oriented Design Principles 
Rule of thumb: NUMA 
extends to I/O and pre-built 
data all the way back 
through time to original 
source creation.
Data-Oriented Design Principles 
Software does not run in a 
magic fairy aether powered 
by the fevered dreams of CS 
PhDs.
Is data-oriented even a thing…? 
…certainly not new ideas. 
…more of a reminder of first principles.
…but it is a response to the culture of 
C++
…but it is a response to the culture of 
C++ 
…and The Three Big Lies it has engendered
i.e. Programmer’s job is NOT to write code; 
Programmer’s job is to solve (data transformation) problems
A simple example…
Solve for the most common case first, 
Not the most generic.
“Can’t the compiler do it?”
A little review…
(AMD Piledriver) 
http://www.agner.org/optimize/instruction_tables.pdf
(AMD Piledriver) 
http://www.agner.org/optimize/instruction_tables.pdf
http://research.scee.net/files/presentations/gcapaustralia09/Pitfalls_of_Object_Oriented_Programming_GCAP_09.pdf
http://www.gameenginebook.com/SINFO.pdf
The Battle of North Bridge 
L1 
L2 
RAM
L2 cache misses/frame 
(Most significant component)
Not even including shared memory modes… 
Name 
GPU-visible 
Cached 
GPU Coherent 
Heap-cacheable No Yes No 
Heap-write-combined No No No 
Physical-uncached ? No No 
GPU-write-combined Yes No No 
GPU-write-combined-read-only Yes No No 
GPU-cacheable Yes Yes Yes 
GPU-cacheable-noncoherent-RO Yes Yes No 
Command-write-combined No No No 
Command-cacheable No Yes Yes
http://deplinenoise.wordpress.com/2013/12/28/optimizable-code/
2 x 32bit read; same cache line = ~200
Float mul, add = ~10
Let’s assume callq is replaced. Sqrt = ~30
Mul back to same addr; in L1; = ~3
Read+add from new line 
= ~200
Time spent waiting for L2 vs. actual work 
~10:1
Time spent waiting for L2 vs. actual work 
~10:1 
This is the compiler’s space.
Time spent waiting for L2 vs. actual work 
~10:1 
This is the compiler’s space.
Compiler cannot solve the most 
significant problems.
Today’s subject: 
The 90% of problem space we 
need to solve that the compiler 
cannot. 
(And how we can help it with the 10% that it can.)
Simple, obvious things to look for 
+ Back of the envelope calculations 
= Substantial wins
L2 cache misses/frame 
(Don’t waste them!)
Waste 56 bytes / 64 bytes
Waste 60 bytes / 64 bytes
90% waste!
Alternatively, 
Only 10% capacity used* 
* Not the same as “used well”, but we’ll start here.
12 bytes x count(5) = 72
12 bytes x count(5) = 72 
4 bytes x count(5) = 20
12 bytes x count(32) = 384 = 64 x 6 
4 bytes x count(32) = 128 = 64 x 2
12 bytes x count(32) = 384 = 64 x 6 
4 bytes x count(32) = 128 = 64 x 2 
(6/32) = ~5.33 loop/cache line
12 bytes x count(32) = 384 = 64 x 6 
4 bytes x count(32) = 128 = 64 x 2 
(6/32) = ~5.33 loop/cache line 
Sqrt + math = ~40 x 5.33 = 213.33 cycles/cache line
12 bytes x count(32) = 384 = 64 x 6 
4 bytes x count(32) = 128 = 64 x 2 
(6/32) = ~5.33 loop/cache line 
Sqrt + math = ~40 x 5.33 = 213.33 cycles/cache line 
+ streaming prefetch bonus
12 bytes x count(32) = 384 = 64 x 6 
4 bytes x count(32) = 128 = 64 x 2 
(6/32) = ~5.33 loop/cache line 
Sqrt + math = ~40 x 5.33 = 213.33 cycles/cache line 
+ streaming prefetch bonus 
Using cache line to capacity* = 
10x speedup 
* Used. Still not necessarily as 
efficiently as possible
In addition… 
1. Code is maintainable 
2. Code is debugable 
3. Can REASON about cost of change 
(6/32) = ~5.33 loop/cache line 
Sqrt + math = ~40 x 5.33 = 213.33 cycles/cache line 
+ streaming prefetch bonus
In addition… 
1. Code is maintainable 
2. Code is debugable 
3. Can REASON about cost of change 
Ignoring inconvenient facts is not engineering; 
It’s dogma. 
(6/32) = ~5.33 loop/cache line 
Sqrt + math = ~40 x 5.33 = 213.33 cycles/cache line 
+ streaming prefetch bonus
bools in structs… (3) Extremely low information density
bools in structs… (3) Extremely low information density 
How big is your cache line?
bools in structs… (3) Extremely low information density 
How big is your cache line? 
What’s the most commonly accessed data? 
64b?
How is it used? What does it generate? (2) Bools and last-minute decision making
MSVC
MSVC 
Re-read and re-test… 
Increment and loop…
Re-read and re-test… 
Increment and loop… 
Why? 
Super-conservative aliasing rules…? 
Member value might change?
What about something more aggressive…?
Test once and return… 
What about something more aggressive…?
Okay, so what about…
…well at least it inlined it?
MSVC doesn’t fare any better…
(4) Ghost reads and writes 
Don’t re-read member values or re-call functions when 
you already have the data.
BAM!
:(
(4) Ghost reads and writes 
Don’t re-read member values or re-call functions when 
you already have the data. 
Hoist all loop-invariant reads and branches. Even super-obvious 
ones that should already be in registers.
:)
:) 
A bit of unnecessary branching, but more-or-less equivalent.
(4) Ghost reads and writes 
Don’t re-read member values or re-call functions when 
you already have the data. 
Hoist all loop-invariant reads and branches. Even super-obvious 
ones that should already be in registers. 
Applies to any member fields especially. 
(Not particular to bools)
(3) Extremely low information density
(3) Extremely low information density 
What is the information density for is_spawn 
over time?
(3) Extremely low information density 
What is the information density for is_spawn 
over time? 
The easy way.
Zip the output 
10,000 frames 
= 915 bytes 
= (915*8)/10,000 
= 0.732 bits/frame
Zip the output 
10,000 frames 
= 915 bytes 
= (915*8)/10,000 
= 0.732 bits/frame 
Alternatively, 
Calculate Shannon Entropy:
(3) Extremely low information density 
What does that tell us?
(3) Extremely low information density 
What does that tell us? 
Figure (~2 L2 misses each frame ) x 10,000 
If each cache line = 64b, 
128b x 10,000 = 1,280,000 bytes
(3) Extremely low information density 
What does that tell us? 
Figure (~2 L2 misses each frame ) x 10,000 
If each cache line = 64b, 
128b x 10,000 = 1,280,000 bytes 
If avg information content = 0.732bits/frame 
X 10,000 = 7320 bits 
/ 8 = 915 bytes
(3) Extremely low information density 
What does that tell us? 
Figure (~2 L2 misses each frame ) x 10,000 
If each cache line = 64b, 
128b x 10,000 = 1,280,000 bytes 
If avg information content = 0.732bits/frame 
X 10,000 = 7320 bits 
/ 8 = 915 bytes 
Percentage waste (Noise::Signal) = 
(1,280,000-915)/1,280,000
What’re the alternatives?
(1) Per-frame…
(1) Per-frame… 
(decision table) 
1 of 512 (8*64) bits used…
(1) Per-frame… 
(decision table) 
1 of 512 (8*64) bits used… 
(a) Make same decision x 512
(1) Per-frame… 
(decision table) 
1 of 512 (8*64) bits used… 
(a) Make same decision x 512 
(b) Combine with other reads / xforms
(1) Per-frame… 
(decision table) 
1 of 512 (8*64) bits used… 
(a) Make same decision x 512 
(b) Combine with other reads / xforms 
Generally simplest. 
- But things cannot exist in abstract bubble. 
- Will require context.
(2) Over-frames…
(2) Over-frames… 
i.e. Only read when needed
(2) Over-frames… 
i.e. Only read when needed 
e.g. 
Arrays of command buffers for future 
frames…
Let’s review some code…
http://yosoygames.com.ar/wp/2013/11/on-mike-actons-review-of-ogrenode-cpp/
(1) Can’t re-arrange memory (much) 
Limited by ABI 
Can’t limit unused reads 
Extra padding
(2) Bools and last-minute decision making
Are we done with the constructor? 
(5) Over-generalization
Are we done with the constructor? 
(5) Over-generalization 
Complex constructors tend to imply that… 
- Reads are unmanaged (one at a time…)
Are we done with the constructor? 
(5) Over-generalization 
Complex constructors tend to imply that… 
- Reads are unmanaged (one at a time…) 
- Unnecessary reads/writes in destructors
Are we done with the constructor? 
(5) Over-generalization 
Complex constructors tend to imply that… 
- Reads are unmanaged (one at a time…) 
- Unnecessary reads/writes in destructors 
- Unmanaged icache (i.e. virtuals) 
=> unmanaged reads/writes
Are we done with the constructor? 
(5) Over-generalization 
Complex constructors tend to imply that… 
- Reads are unmanaged (one at a time…) 
- Unnecessary reads/writes in destructors 
- Unmanaged icache (i.e. virtuals) 
=> unmanaged reads/writes 
- Unnecessarily complex state machines (back to bools) 
- E.g. 2^7 states
Are we done with the constructor? 
(5) Over-generalization 
Complex constructors tend to imply that… 
- Reads are unmanaged (one at a time…) 
- Unnecessary reads/writes in destructors 
- Unmanaged icache (i.e. virtuals) 
=> unmanaged reads/writes 
- Unnecessarily complex state machines (back to bools) 
- E.g. 2^7 states 
Rule of thumb: 
Store each state type separately 
Store same states together 
(No state value needed)
Are we done with the constructor? 
(5) Over-generalization 
(6) Undefined or under-defined constraints
Are we done with the constructor? 
(5) Over-generalization 
(6) Undefined or under-defined constraints 
Imply more (wasted) reads because pretending you 
don’t know what it could be.
Are we done with the constructor? 
(5) Over-generalization 
(6) Undefined or under-defined constraints 
Imply more (wasted) reads because pretending you 
don’t know what it could be. 
e.g. Strings, generally. Filenames, in particular.
Are we done with the constructor? 
(5) Over-generalization 
(6) Undefined or under-defined constraints 
Imply more (wasted) reads because pretending you 
don’t know what it could be. 
e.g. Strings, generally. Filenames, in particular. 
Rule of thumb: 
The best code is code that doesn’t need to exist. 
Do it offline. Do it once. 
e.g. precompiled string hashes
Are we done with the constructor? 
(5) Over-generalization 
(6) Undefined or under-defined constraints 
(7) Over-solving (computing too much) 
Compiler doesn’t have enough context to know 
how to simplify your problems for you.
Are we done with the constructor? 
(5) Over-generalization 
(6) Undefined or under-defined constraints 
(7) Over-solving (computing too much) 
Compiler doesn’t have enough context to know 
how to simplify your problems for you. 
But you can make simple tools that do… 
- E.g. Premultiply matrices
Are we done with the constructor? 
(5) Over-generalization 
(6) Undefined or under-defined constraints 
(7) Over-solving (computing too much) 
Compiler doesn’t have enough context to know 
how to simplify your problems for you. 
But you can make simple tools that do… 
- E.g. Premultiply matrices 
Work with the (actual) data you have. 
- E.g. Sparse or affine matrices
How do we approach “fixing” 
it?
(2) Bools and last-minute decision making
Step 1: organize 
Separate states so you can reason about them
Step 1: organize 
Separate states so you can reason about them 
Step 2: triage 
What are the relative values of each case 
i.e. p(call) * count
Step 1: organize 
Separate states so you can reason about them 
Step 2: triage 
What are the relative values of each case 
i.e. p(call) * count 
e.g. in-game vs. in-editor
Step 1: organize 
Separate states so you can reason about them 
Step 2: triage 
What are the relative values of each case 
i.e. p(call) * count 
Step 3: reduce waste
(back of the envelope read cost) 
~200 cycles x 2 x count
(back of the envelope read cost) 
~200 cycles x 2 x count 
~2.28 count per 200 cycles 
= ~88
(back of the envelope read cost) 
~200 cycles x 2 x count 
~2.28 count per 200 cycles 
= ~88 
t = 2 * cross(q.xyz, v) 
v' = v + q.w * t + cross(q.xyz, t)
(back of the envelope read cost) 
~200 cycles x 2 x count 
~2.28 count per 200 cycles 
= ~88 
t = 2 * cross(q.xyz, v) 
v' = v + q.w * t + cross(q.xyz, t) 
(close enough to dig in and 
measure)
Apply the same steps recursively…
Apply the same steps recursively… 
Step 1: organize 
Separate states so you can reason about them 
Root or not; Calling function with context can distinguish
Apply the same steps recursively… 
Step 1: organize 
Separate states so you can reason about them 
Root or not; Calling function with context can distinguish
Apply the same steps recursively… 
Step 1: organize 
Separate states so you can reason about them
Apply the same steps recursively… 
Step 1: organize 
Separate states so you can reason about them 
Can’t reason well about the cost from…
Step 1: organize 
Separate states so you can reason about them
Step 1: organize 
Separate states so you can reason about them 
Step 2: triage 
What are the relative values of each case 
i.e. p(call) * count 
Step 3: reduce waste
Good News: 
Most problems are 
easy to see.
Good News: 
Side-effect of solving the 90% 
well, compiler can solve the 10% 
better.
Good News: 
Organized data makes 
maintenance, debugging and 
concurrency much easier
Bad News: 
Good programming is hard. 
Bad programming is easy.
While we’re on the subject… 
DESIGN PATTERNS: 
http://realtimecollisiondetection.net/blog/?p=81 
http://realtimecollisiondetection.net/blog/?p=44 
“
Data oriented design and c++
Data oriented design and c++

More Related Content

What's hot

08_게임 물리 프로그래밍 가이드
08_게임 물리 프로그래밍 가이드08_게임 물리 프로그래밍 가이드
08_게임 물리 프로그래밍 가이드noerror
 
Decima Engine: Visibility in Horizon Zero Dawn
Decima Engine: Visibility in Horizon Zero DawnDecima Engine: Visibility in Horizon Zero Dawn
Decima Engine: Visibility in Horizon Zero DawnGuerrilla
 
The Rendering Technology of Killzone 2
The Rendering Technology of Killzone 2The Rendering Technology of Killzone 2
The Rendering Technology of Killzone 2Guerrilla
 
Screen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space MarineScreen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space MarinePope Kim
 
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...Johan Andersson
 
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
4K Checkerboard in Battlefield 1 and Mass Effect AndromedaElectronic Arts / DICE
 
Killzone Shadow Fall Demo Postmortem
Killzone Shadow Fall Demo PostmortemKillzone Shadow Fall Demo Postmortem
Killzone Shadow Fall Demo PostmortemGuerrilla
 
충돌 알고리즘(collision detection algorithms)
충돌 알고리즘(collision detection algorithms)충돌 알고리즘(collision detection algorithms)
충돌 알고리즘(collision detection algorithms)ssuserbe87d6
 
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14AMD Developer Central
 
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)포프 김
 
[IGC 2017] 펄어비스 민경인 - Mmorpg를 위한 voxel 기반 네비게이션 라이브러리 개발기
[IGC 2017] 펄어비스 민경인 - Mmorpg를 위한 voxel 기반 네비게이션 라이브러리 개발기[IGC 2017] 펄어비스 민경인 - Mmorpg를 위한 voxel 기반 네비게이션 라이브러리 개발기
[IGC 2017] 펄어비스 민경인 - Mmorpg를 위한 voxel 기반 네비게이션 라이브러리 개발기강 민우
 
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...Unity Technologies
 
Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)Tiago Sousa
 
[Ndc11 박민근] deferred shading
[Ndc11 박민근] deferred shading[Ndc11 박민근] deferred shading
[Ndc11 박민근] deferred shadingMinGeun Park
 
Crysis Next-Gen Effects (GDC 2008)
Crysis Next-Gen Effects (GDC 2008)Crysis Next-Gen Effects (GDC 2008)
Crysis Next-Gen Effects (GDC 2008)Tiago Sousa
 
Volumetric Lighting for Many Lights in Lords of the Fallen
Volumetric Lighting for Many Lights in Lords of the FallenVolumetric Lighting for Many Lights in Lords of the Fallen
Volumetric Lighting for Many Lights in Lords of the FallenBenjamin Glatzel
 
파이썬 생존 안내서 (자막)
파이썬 생존 안내서 (자막)파이썬 생존 안내서 (자막)
파이썬 생존 안내서 (자막)Heungsub Lee
 

What's hot (20)

08_게임 물리 프로그래밍 가이드
08_게임 물리 프로그래밍 가이드08_게임 물리 프로그래밍 가이드
08_게임 물리 프로그래밍 가이드
 
Decima Engine: Visibility in Horizon Zero Dawn
Decima Engine: Visibility in Horizon Zero DawnDecima Engine: Visibility in Horizon Zero Dawn
Decima Engine: Visibility in Horizon Zero Dawn
 
The Rendering Technology of Killzone 2
The Rendering Technology of Killzone 2The Rendering Technology of Killzone 2
The Rendering Technology of Killzone 2
 
Screen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space MarineScreen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space Marine
 
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
 
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
 
Killzone Shadow Fall Demo Postmortem
Killzone Shadow Fall Demo PostmortemKillzone Shadow Fall Demo Postmortem
Killzone Shadow Fall Demo Postmortem
 
충돌 알고리즘(collision detection algorithms)
충돌 알고리즘(collision detection algorithms)충돌 알고리즘(collision detection algorithms)
충돌 알고리즘(collision detection algorithms)
 
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
 
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
 
[IGC 2017] 펄어비스 민경인 - Mmorpg를 위한 voxel 기반 네비게이션 라이브러리 개발기
[IGC 2017] 펄어비스 민경인 - Mmorpg를 위한 voxel 기반 네비게이션 라이브러리 개발기[IGC 2017] 펄어비스 민경인 - Mmorpg를 위한 voxel 기반 네비게이션 라이브러리 개발기
[IGC 2017] 펄어비스 민경인 - Mmorpg를 위한 voxel 기반 네비게이션 라이브러리 개발기
 
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
 
Relic's FX System
Relic's FX SystemRelic's FX System
Relic's FX System
 
Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)
 
[Ndc11 박민근] deferred shading
[Ndc11 박민근] deferred shading[Ndc11 박민근] deferred shading
[Ndc11 박민근] deferred shading
 
Crysis Next-Gen Effects (GDC 2008)
Crysis Next-Gen Effects (GDC 2008)Crysis Next-Gen Effects (GDC 2008)
Crysis Next-Gen Effects (GDC 2008)
 
Volumetric Lighting for Many Lights in Lords of the Fallen
Volumetric Lighting for Many Lights in Lords of the FallenVolumetric Lighting for Many Lights in Lords of the Fallen
Volumetric Lighting for Many Lights in Lords of the Fallen
 
Rendering Battlefield 4 with Mantle
Rendering Battlefield 4 with MantleRendering Battlefield 4 with Mantle
Rendering Battlefield 4 with Mantle
 
파이썬 생존 안내서 (자막)
파이썬 생존 안내서 (자막)파이썬 생존 안내서 (자막)
파이썬 생존 안내서 (자막)
 
Frostbite on Mobile
Frostbite on MobileFrostbite on Mobile
Frostbite on Mobile
 

Viewers also liked

Great management of technical leads
Great management of technical leadsGreat management of technical leads
Great management of technical leadsMike Acton
 
#GDC15 Great Management of Technical Leads
#GDC15 Great Management of Technical Leads#GDC15 Great Management of Technical Leads
#GDC15 Great Management of Technical LeadsMike Acton
 
Game tools as a webapp (2011)
Game tools as a webapp (2011)Game tools as a webapp (2011)
Game tools as a webapp (2011)Mike Acton
 
Unite2014: Mastering Physically Based Shading in Unity 5
Unite2014: Mastering Physically Based Shading in Unity 5Unite2014: Mastering Physically Based Shading in Unity 5
Unite2014: Mastering Physically Based Shading in Unity 5Renaldas Zioma
 
Introduction to Data-Oriented Design
Introduction to Data-Oriented DesignIntroduction to Data-Oriented Design
Introduction to Data-Oriented DesignIT Weekend
 
Deferred rendering in Dying Light
Deferred rendering in Dying LightDeferred rendering in Dying Light
Deferred rendering in Dying LightMaciej Jamrozik
 
OGDC 2014: Component based entity system mobile game development
OGDC 2014: Component based entity system mobile game developmentOGDC 2014: Component based entity system mobile game development
OGDC 2014: Component based entity system mobile game developmentGameLandVN
 
Gdc2013 macton usability_is_not_random
Gdc2013 macton usability_is_not_randomGdc2013 macton usability_is_not_random
Gdc2013 macton usability_is_not_randomMike Acton
 
Nordic stockholm keynote
Nordic stockholm keynoteNordic stockholm keynote
Nordic stockholm keynoteMike Acton
 
Rebooting the insomniac tools pax dev12
Rebooting the insomniac tools pax dev12Rebooting the insomniac tools pax dev12
Rebooting the insomniac tools pax dev12Mike Acton
 
Data oriented design
Data oriented designData oriented design
Data oriented designMax Klyga
 
Cinematic quests
Cinematic questsCinematic quests
Cinematic questsMike Acton
 
Intro to data oriented design
Intro to data oriented designIntro to data oriented design
Intro to data oriented designStoyan Nikolov
 
Your Game Needs Direct3D 11, So Get Started Now!
Your Game Needs Direct3D 11, So Get Started Now!Your Game Needs Direct3D 11, So Get Started Now!
Your Game Needs Direct3D 11, So Get Started Now!Johan Andersson
 
Game Programming 02 - Component-Based Entity Systems
Game Programming 02 - Component-Based Entity SystemsGame Programming 02 - Component-Based Entity Systems
Game Programming 02 - Component-Based Entity SystemsNick Pruehs
 
Making (console) games in the browser
Making (console) games in the browserMaking (console) games in the browser
Making (console) games in the browserMike Acton
 
New Media Webcam Presentation
New Media Webcam PresentationNew Media Webcam Presentation
New Media Webcam PresentationEmily
 
Shadows & Decals: D3D10 Techniques in Frostbite (GDC'09)
 	 Shadows & Decals: D3D10 Techniques in Frostbite (GDC'09) 	 Shadows & Decals: D3D10 Techniques in Frostbite (GDC'09)
Shadows & Decals: D3D10 Techniques in Frostbite (GDC'09)Johan Andersson
 

Viewers also liked (20)

Great management of technical leads
Great management of technical leadsGreat management of technical leads
Great management of technical leads
 
#GDC15 Great Management of Technical Leads
#GDC15 Great Management of Technical Leads#GDC15 Great Management of Technical Leads
#GDC15 Great Management of Technical Leads
 
Game tools as a webapp (2011)
Game tools as a webapp (2011)Game tools as a webapp (2011)
Game tools as a webapp (2011)
 
Unite2014: Mastering Physically Based Shading in Unity 5
Unite2014: Mastering Physically Based Shading in Unity 5Unite2014: Mastering Physically Based Shading in Unity 5
Unite2014: Mastering Physically Based Shading in Unity 5
 
Introduction to Data-Oriented Design
Introduction to Data-Oriented DesignIntroduction to Data-Oriented Design
Introduction to Data-Oriented Design
 
Deferred rendering in Dying Light
Deferred rendering in Dying LightDeferred rendering in Dying Light
Deferred rendering in Dying Light
 
OGDC 2014: Component based entity system mobile game development
OGDC 2014: Component based entity system mobile game developmentOGDC 2014: Component based entity system mobile game development
OGDC 2014: Component based entity system mobile game development
 
Gdc2013 macton usability_is_not_random
Gdc2013 macton usability_is_not_randomGdc2013 macton usability_is_not_random
Gdc2013 macton usability_is_not_random
 
Nordic stockholm keynote
Nordic stockholm keynoteNordic stockholm keynote
Nordic stockholm keynote
 
Rebooting the insomniac tools pax dev12
Rebooting the insomniac tools pax dev12Rebooting the insomniac tools pax dev12
Rebooting the insomniac tools pax dev12
 
Data oriented design
Data oriented designData oriented design
Data oriented design
 
Cinematic quests
Cinematic questsCinematic quests
Cinematic quests
 
Intro to data oriented design
Intro to data oriented designIntro to data oriented design
Intro to data oriented design
 
Your Game Needs Direct3D 11, So Get Started Now!
Your Game Needs Direct3D 11, So Get Started Now!Your Game Needs Direct3D 11, So Get Started Now!
Your Game Needs Direct3D 11, So Get Started Now!
 
Machine Cycle
Machine CycleMachine Cycle
Machine Cycle
 
Game Programming 02 - Component-Based Entity Systems
Game Programming 02 - Component-Based Entity SystemsGame Programming 02 - Component-Based Entity Systems
Game Programming 02 - Component-Based Entity Systems
 
Making (console) games in the browser
Making (console) games in the browserMaking (console) games in the browser
Making (console) games in the browser
 
Webcam
WebcamWebcam
Webcam
 
New Media Webcam Presentation
New Media Webcam PresentationNew Media Webcam Presentation
New Media Webcam Presentation
 
Shadows & Decals: D3D10 Techniques in Frostbite (GDC'09)
 	 Shadows & Decals: D3D10 Techniques in Frostbite (GDC'09) 	 Shadows & Decals: D3D10 Techniques in Frostbite (GDC'09)
Shadows & Decals: D3D10 Techniques in Frostbite (GDC'09)
 

Similar to Data oriented design and c++

Performance and predictability (1)
Performance and predictability (1)Performance and predictability (1)
Performance and predictability (1)RichardWarburton
 
Performance and Predictability - Richard Warburton
Performance and Predictability - Richard WarburtonPerformance and Predictability - Richard Warburton
Performance and Predictability - Richard WarburtonJAXLondon2014
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structureselliando dias
 
Approximate "Now" is Better Than Accurate "Later"
Approximate "Now" is Better Than Accurate "Later"Approximate "Now" is Better Than Accurate "Later"
Approximate "Now" is Better Than Accurate "Later"NUS-ISS
 
Moved to https://slidr.io/azzazzel/web-application-performance-tuning-beyond-xmx
Moved to https://slidr.io/azzazzel/web-application-performance-tuning-beyond-xmxMoved to https://slidr.io/azzazzel/web-application-performance-tuning-beyond-xmx
Moved to https://slidr.io/azzazzel/web-application-performance-tuning-beyond-xmxMilen Dyankov
 
Gopher in performance_tales_ms_go_cracow
Gopher in performance_tales_ms_go_cracowGopher in performance_tales_ms_go_cracow
Gopher in performance_tales_ms_go_cracowMateuszSzczyrzyca
 
MongoDB for Time Series Data: Sharding
MongoDB for Time Series Data: ShardingMongoDB for Time Series Data: Sharding
MongoDB for Time Series Data: ShardingMongoDB
 
Infrastructure as code might be literally impossible part 2
Infrastructure as code might be literally impossible part 2Infrastructure as code might be literally impossible part 2
Infrastructure as code might be literally impossible part 2ice799
 
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 20197 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019Dave Stokes
 
Code and Memory Optimisation Tricks
Code and Memory Optimisation Tricks Code and Memory Optimisation Tricks
Code and Memory Optimisation Tricks Sperasoft
 
Code and memory optimization tricks
Code and memory optimization tricksCode and memory optimization tricks
Code and memory optimization tricksDevGAMM Conference
 
What does OOP stand for?
What does OOP stand for?What does OOP stand for?
What does OOP stand for?Colin Riley
 
Deploying MLlib for Scoring in Structured Streaming with Joseph Bradley
Deploying MLlib for Scoring in Structured Streaming with Joseph BradleyDeploying MLlib for Scoring in Structured Streaming with Joseph Bradley
Deploying MLlib for Scoring in Structured Streaming with Joseph BradleyDatabricks
 
Tales from the Field
Tales from the FieldTales from the Field
Tales from the FieldMongoDB
 
Know your platform. 7 things every scala developer should know about jvm
Know your platform. 7 things every scala developer should know about jvmKnow your platform. 7 things every scala developer should know about jvm
Know your platform. 7 things every scala developer should know about jvmPawel Szulc
 
Ekon24 from Delphi to AVX2
Ekon24 from Delphi to AVX2Ekon24 from Delphi to AVX2
Ekon24 from Delphi to AVX2Arnaud Bouchez
 
Computação Paralela: Benefícios e Desafios - Intel Software Conference 2013
Computação Paralela: Benefícios e Desafios - Intel Software Conference 2013Computação Paralela: Benefícios e Desafios - Intel Software Conference 2013
Computação Paralela: Benefícios e Desafios - Intel Software Conference 2013Intel Software Brasil
 
Presto at Tivo, Boston Hadoop Meetup
Presto at Tivo, Boston Hadoop MeetupPresto at Tivo, Boston Hadoop Meetup
Presto at Tivo, Boston Hadoop MeetupJustin Borgman
 

Similar to Data oriented design and c++ (20)

Software + Babies
Software + BabiesSoftware + Babies
Software + Babies
 
Performance and predictability (1)
Performance and predictability (1)Performance and predictability (1)
Performance and predictability (1)
 
Performance and Predictability - Richard Warburton
Performance and Predictability - Richard WarburtonPerformance and Predictability - Richard Warburton
Performance and Predictability - Richard Warburton
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structures
 
Approximate "Now" is Better Than Accurate "Later"
Approximate "Now" is Better Than Accurate "Later"Approximate "Now" is Better Than Accurate "Later"
Approximate "Now" is Better Than Accurate "Later"
 
Moved to https://slidr.io/azzazzel/web-application-performance-tuning-beyond-xmx
Moved to https://slidr.io/azzazzel/web-application-performance-tuning-beyond-xmxMoved to https://slidr.io/azzazzel/web-application-performance-tuning-beyond-xmx
Moved to https://slidr.io/azzazzel/web-application-performance-tuning-beyond-xmx
 
Gopher in performance_tales_ms_go_cracow
Gopher in performance_tales_ms_go_cracowGopher in performance_tales_ms_go_cracow
Gopher in performance_tales_ms_go_cracow
 
MongoDB for Time Series Data: Sharding
MongoDB for Time Series Data: ShardingMongoDB for Time Series Data: Sharding
MongoDB for Time Series Data: Sharding
 
Infrastructure as code might be literally impossible part 2
Infrastructure as code might be literally impossible part 2Infrastructure as code might be literally impossible part 2
Infrastructure as code might be literally impossible part 2
 
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 20197 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
 
Code and Memory Optimisation Tricks
Code and Memory Optimisation Tricks Code and Memory Optimisation Tricks
Code and Memory Optimisation Tricks
 
Code and memory optimization tricks
Code and memory optimization tricksCode and memory optimization tricks
Code and memory optimization tricks
 
What does OOP stand for?
What does OOP stand for?What does OOP stand for?
What does OOP stand for?
 
Deploying MLlib for Scoring in Structured Streaming with Joseph Bradley
Deploying MLlib for Scoring in Structured Streaming with Joseph BradleyDeploying MLlib for Scoring in Structured Streaming with Joseph Bradley
Deploying MLlib for Scoring in Structured Streaming with Joseph Bradley
 
Tales from the Field
Tales from the FieldTales from the Field
Tales from the Field
 
Know your platform. 7 things every scala developer should know about jvm
Know your platform. 7 things every scala developer should know about jvmKnow your platform. 7 things every scala developer should know about jvm
Know your platform. 7 things every scala developer should know about jvm
 
Ekon24 from Delphi to AVX2
Ekon24 from Delphi to AVX2Ekon24 from Delphi to AVX2
Ekon24 from Delphi to AVX2
 
Computação Paralela: Benefícios e Desafios - Intel Software Conference 2013
Computação Paralela: Benefícios e Desafios - Intel Software Conference 2013Computação Paralela: Benefícios e Desafios - Intel Software Conference 2013
Computação Paralela: Benefícios e Desafios - Intel Software Conference 2013
 
Hadoop bank
Hadoop bankHadoop bank
Hadoop bank
 
Presto at Tivo, Boston Hadoop Meetup
Presto at Tivo, Boston Hadoop MeetupPresto at Tivo, Boston Hadoop Meetup
Presto at Tivo, Boston Hadoop Meetup
 

Recently uploaded

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Recently uploaded (20)

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

Data oriented design and c++

  • 1. Data-Oriented Design and C++ Mike Acton Engine Director, Insomniac Games @mike_acton
  • 2. A bit of background…
  • 3. What does an “Engine” team do?
  • 4. Runtime systems e.g. • Rendering • Animation and gestures • Streaming • Cinematics • VFX • Post-FX • Navigation • Localization • …many, many more!
  • 5. Development tools e.g. • Level creation • Lighting • Material editing • VFX creation • Animation/state machine editing • Visual scripting • Scene painting • Cinematics creation • …many, many more!
  • 7. What’s important to us? • Hard deadlines
  • 8. What’s important to us? • Hard deadlines • Soft realtime performance requirements (Soft=33ms)
  • 9. What’s important to us? • Hard deadlines • Soft realtime performance requirements (Soft=33ms) • Usability
  • 10. What’s important to us? • Hard deadlines • Soft realtime performance requirements (Soft=33ms) • Usability • Performance
  • 11. What’s important to us? • Hard deadlines • Soft realtime performance requirements (Soft=33ms) • Usability • Performance • Maintenance
  • 12. What’s important to us? • Hard deadlines • Soft realtime performance requirements (Soft=33ms) • Usability • Performance • Maintenance • Debugability
  • 13. What languages do we use…?
  • 14. What languages do we use…? • C • C++ • Asm • Perl • Javascript • C#
  • 15. What languages do we use…? • C • C++  ~70% • Asm • Perl • Javascript • C#
  • 16. What languages do we use…? • C • C++  ~70% • Asm • Perl • Javascript • C# • Pixel shaders, vertex shaders, geometry shaders, compute shaders, …
  • 17. We don’t make games for Mars but…
  • 18. How are games like the Mars rovers?
  • 19. How are games like the Mars rovers? •Exceptions
  • 20. How are games like the Mars rovers? •Exceptions •Templates
  • 21. How are games like the Mars rovers? •Exceptions •Templates • Iostream
  • 22. How are games like the Mars rovers? •Exceptions •Templates • Iostream • Multiple inheritance
  • 23. How are games like the Mars rovers? •Exceptions •Templates • Iostream • Multiple inheritance •Operator overloading
  • 24. How are games like the Mars rovers? •Exceptions •Templates • Iostream • Multiple inheritance •Operator overloading •RTTI
  • 25. How are games like the Mars rovers? •No STL
  • 26. How are games like the Mars rovers? •No STL •Custom allocators (lots)
  • 27. How are games like the Mars rovers? •No STL •Custom allocators (lots) •Custom debugging tools
  • 28. Is data-oriented even a thing…?
  • 29. Data-Oriented Design Principles The purpose of all programs, and all parts of those programs, is to transform data from one form to another.
  • 30. Data-Oriented Design Principles If you don’t understand the data you don’t understand the problem.
  • 31. Data-Oriented Design Principles Conversely, understand the problem by understanding the data.
  • 32. Data-Oriented Design Principles Different problems require different solutions.
  • 33. Data-Oriented Design Principles If you have different data, you have a different problem.
  • 34. Data-Oriented Design Principles If you don’t understand the cost of solving the problem, you don’t understand the problem.
  • 35. Data-Oriented Design Principles If you don’t understand the hardware, you can’t reason about the cost of solving the problem.
  • 36. Data-Oriented Design Principles Everything is a data problem. Including usability, maintenance, debug-ability, etc. Everything.
  • 37. Data-Oriented Design Principles Solving problems you probably don’t have creates more problems you definitely do.
  • 38. Data-Oriented Design Principles Latency and throughput are only the same in sequential systems.
  • 39. Data-Oriented Design Principles Latency and throughput are only the same in sequential systems.
  • 40. Data-Oriented Design Principles Rule of thumb: Where there is one, there are many. Try looking on the time axis.
  • 41. Data-Oriented Design Principles Rule of thumb: The more context you have, the better you can make the solution. Don’t throw away data you need.
  • 42. Data-Oriented Design Principles Rule of thumb: NUMA extends to I/O and pre-built data all the way back through time to original source creation.
  • 43. Data-Oriented Design Principles Software does not run in a magic fairy aether powered by the fevered dreams of CS PhDs.
  • 44. Is data-oriented even a thing…? …certainly not new ideas. …more of a reminder of first principles.
  • 45. …but it is a response to the culture of C++
  • 46. …but it is a response to the culture of C++ …and The Three Big Lies it has engendered
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64. i.e. Programmer’s job is NOT to write code; Programmer’s job is to solve (data transformation) problems
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82. Solve for the most common case first, Not the most generic.
  • 89. The Battle of North Bridge L1 L2 RAM
  • 90. L2 cache misses/frame (Most significant component)
  • 91. Not even including shared memory modes… Name GPU-visible Cached GPU Coherent Heap-cacheable No Yes No Heap-write-combined No No No Physical-uncached ? No No GPU-write-combined Yes No No GPU-write-combined-read-only Yes No No GPU-cacheable Yes Yes Yes GPU-cacheable-noncoherent-RO Yes Yes No Command-write-combined No No No Command-cacheable No Yes Yes
  • 93.
  • 94. 2 x 32bit read; same cache line = ~200
  • 95. Float mul, add = ~10
  • 96. Let’s assume callq is replaced. Sqrt = ~30
  • 97. Mul back to same addr; in L1; = ~3
  • 98. Read+add from new line = ~200
  • 99. Time spent waiting for L2 vs. actual work ~10:1
  • 100. Time spent waiting for L2 vs. actual work ~10:1 This is the compiler’s space.
  • 101. Time spent waiting for L2 vs. actual work ~10:1 This is the compiler’s space.
  • 102. Compiler cannot solve the most significant problems.
  • 103. Today’s subject: The 90% of problem space we need to solve that the compiler cannot. (And how we can help it with the 10% that it can.)
  • 104. Simple, obvious things to look for + Back of the envelope calculations = Substantial wins
  • 105. L2 cache misses/frame (Don’t waste them!)
  • 106. Waste 56 bytes / 64 bytes
  • 107. Waste 60 bytes / 64 bytes
  • 109. Alternatively, Only 10% capacity used* * Not the same as “used well”, but we’ll start here.
  • 110.
  • 111. 12 bytes x count(5) = 72
  • 112. 12 bytes x count(5) = 72 4 bytes x count(5) = 20
  • 113. 12 bytes x count(32) = 384 = 64 x 6 4 bytes x count(32) = 128 = 64 x 2
  • 114. 12 bytes x count(32) = 384 = 64 x 6 4 bytes x count(32) = 128 = 64 x 2 (6/32) = ~5.33 loop/cache line
  • 115. 12 bytes x count(32) = 384 = 64 x 6 4 bytes x count(32) = 128 = 64 x 2 (6/32) = ~5.33 loop/cache line Sqrt + math = ~40 x 5.33 = 213.33 cycles/cache line
  • 116. 12 bytes x count(32) = 384 = 64 x 6 4 bytes x count(32) = 128 = 64 x 2 (6/32) = ~5.33 loop/cache line Sqrt + math = ~40 x 5.33 = 213.33 cycles/cache line + streaming prefetch bonus
  • 117. 12 bytes x count(32) = 384 = 64 x 6 4 bytes x count(32) = 128 = 64 x 2 (6/32) = ~5.33 loop/cache line Sqrt + math = ~40 x 5.33 = 213.33 cycles/cache line + streaming prefetch bonus Using cache line to capacity* = 10x speedup * Used. Still not necessarily as efficiently as possible
  • 118. In addition… 1. Code is maintainable 2. Code is debugable 3. Can REASON about cost of change (6/32) = ~5.33 loop/cache line Sqrt + math = ~40 x 5.33 = 213.33 cycles/cache line + streaming prefetch bonus
  • 119. In addition… 1. Code is maintainable 2. Code is debugable 3. Can REASON about cost of change Ignoring inconvenient facts is not engineering; It’s dogma. (6/32) = ~5.33 loop/cache line Sqrt + math = ~40 x 5.33 = 213.33 cycles/cache line + streaming prefetch bonus
  • 120. bools in structs… (3) Extremely low information density
  • 121. bools in structs… (3) Extremely low information density How big is your cache line?
  • 122. bools in structs… (3) Extremely low information density How big is your cache line? What’s the most commonly accessed data? 64b?
  • 123. How is it used? What does it generate? (2) Bools and last-minute decision making
  • 124. MSVC
  • 125. MSVC Re-read and re-test… Increment and loop…
  • 126. Re-read and re-test… Increment and loop… Why? Super-conservative aliasing rules…? Member value might change?
  • 127. What about something more aggressive…?
  • 128. Test once and return… What about something more aggressive…?
  • 129. Okay, so what about…
  • 130. …well at least it inlined it?
  • 131. MSVC doesn’t fare any better…
  • 132. (4) Ghost reads and writes Don’t re-read member values or re-call functions when you already have the data.
  • 133. BAM!
  • 134. :(
  • 135. (4) Ghost reads and writes Don’t re-read member values or re-call functions when you already have the data. Hoist all loop-invariant reads and branches. Even super-obvious ones that should already be in registers.
  • 136. :)
  • 137. :) A bit of unnecessary branching, but more-or-less equivalent.
  • 138. (4) Ghost reads and writes Don’t re-read member values or re-call functions when you already have the data. Hoist all loop-invariant reads and branches. Even super-obvious ones that should already be in registers. Applies to any member fields especially. (Not particular to bools)
  • 139. (3) Extremely low information density
  • 140. (3) Extremely low information density What is the information density for is_spawn over time?
  • 141. (3) Extremely low information density What is the information density for is_spawn over time? The easy way.
  • 142.
  • 143. Zip the output 10,000 frames = 915 bytes = (915*8)/10,000 = 0.732 bits/frame
  • 144. Zip the output 10,000 frames = 915 bytes = (915*8)/10,000 = 0.732 bits/frame Alternatively, Calculate Shannon Entropy:
  • 145. (3) Extremely low information density What does that tell us?
  • 146. (3) Extremely low information density What does that tell us? Figure (~2 L2 misses each frame ) x 10,000 If each cache line = 64b, 128b x 10,000 = 1,280,000 bytes
  • 147. (3) Extremely low information density What does that tell us? Figure (~2 L2 misses each frame ) x 10,000 If each cache line = 64b, 128b x 10,000 = 1,280,000 bytes If avg information content = 0.732bits/frame X 10,000 = 7320 bits / 8 = 915 bytes
  • 148. (3) Extremely low information density What does that tell us? Figure (~2 L2 misses each frame ) x 10,000 If each cache line = 64b, 128b x 10,000 = 1,280,000 bytes If avg information content = 0.732bits/frame X 10,000 = 7320 bits / 8 = 915 bytes Percentage waste (Noise::Signal) = (1,280,000-915)/1,280,000
  • 151. (1) Per-frame… (decision table) 1 of 512 (8*64) bits used…
  • 152. (1) Per-frame… (decision table) 1 of 512 (8*64) bits used… (a) Make same decision x 512
  • 153. (1) Per-frame… (decision table) 1 of 512 (8*64) bits used… (a) Make same decision x 512 (b) Combine with other reads / xforms
  • 154. (1) Per-frame… (decision table) 1 of 512 (8*64) bits used… (a) Make same decision x 512 (b) Combine with other reads / xforms Generally simplest. - But things cannot exist in abstract bubble. - Will require context.
  • 156. (2) Over-frames… i.e. Only read when needed
  • 157. (2) Over-frames… i.e. Only read when needed e.g. Arrays of command buffers for future frames…
  • 159.
  • 161.
  • 162. (1) Can’t re-arrange memory (much) Limited by ABI Can’t limit unused reads Extra padding
  • 163. (2) Bools and last-minute decision making
  • 164. Are we done with the constructor? (5) Over-generalization
  • 165. Are we done with the constructor? (5) Over-generalization Complex constructors tend to imply that… - Reads are unmanaged (one at a time…)
  • 166. Are we done with the constructor? (5) Over-generalization Complex constructors tend to imply that… - Reads are unmanaged (one at a time…) - Unnecessary reads/writes in destructors
  • 167. Are we done with the constructor? (5) Over-generalization Complex constructors tend to imply that… - Reads are unmanaged (one at a time…) - Unnecessary reads/writes in destructors - Unmanaged icache (i.e. virtuals) => unmanaged reads/writes
  • 168. Are we done with the constructor? (5) Over-generalization Complex constructors tend to imply that… - Reads are unmanaged (one at a time…) - Unnecessary reads/writes in destructors - Unmanaged icache (i.e. virtuals) => unmanaged reads/writes - Unnecessarily complex state machines (back to bools) - E.g. 2^7 states
  • 169. Are we done with the constructor? (5) Over-generalization Complex constructors tend to imply that… - Reads are unmanaged (one at a time…) - Unnecessary reads/writes in destructors - Unmanaged icache (i.e. virtuals) => unmanaged reads/writes - Unnecessarily complex state machines (back to bools) - E.g. 2^7 states Rule of thumb: Store each state type separately Store same states together (No state value needed)
  • 170. Are we done with the constructor? (5) Over-generalization (6) Undefined or under-defined constraints
  • 171. Are we done with the constructor? (5) Over-generalization (6) Undefined or under-defined constraints Imply more (wasted) reads because pretending you don’t know what it could be.
  • 172. Are we done with the constructor? (5) Over-generalization (6) Undefined or under-defined constraints Imply more (wasted) reads because pretending you don’t know what it could be. e.g. Strings, generally. Filenames, in particular.
  • 173. Are we done with the constructor? (5) Over-generalization (6) Undefined or under-defined constraints Imply more (wasted) reads because pretending you don’t know what it could be. e.g. Strings, generally. Filenames, in particular. Rule of thumb: The best code is code that doesn’t need to exist. Do it offline. Do it once. e.g. precompiled string hashes
  • 174. Are we done with the constructor? (5) Over-generalization (6) Undefined or under-defined constraints (7) Over-solving (computing too much) Compiler doesn’t have enough context to know how to simplify your problems for you.
  • 175. Are we done with the constructor? (5) Over-generalization (6) Undefined or under-defined constraints (7) Over-solving (computing too much) Compiler doesn’t have enough context to know how to simplify your problems for you. But you can make simple tools that do… - E.g. Premultiply matrices
  • 176. Are we done with the constructor? (5) Over-generalization (6) Undefined or under-defined constraints (7) Over-solving (computing too much) Compiler doesn’t have enough context to know how to simplify your problems for you. But you can make simple tools that do… - E.g. Premultiply matrices Work with the (actual) data you have. - E.g. Sparse or affine matrices
  • 177. How do we approach “fixing” it?
  • 178.
  • 179. (2) Bools and last-minute decision making
  • 180. Step 1: organize Separate states so you can reason about them
  • 181. Step 1: organize Separate states so you can reason about them Step 2: triage What are the relative values of each case i.e. p(call) * count
  • 182. Step 1: organize Separate states so you can reason about them Step 2: triage What are the relative values of each case i.e. p(call) * count e.g. in-game vs. in-editor
  • 183. Step 1: organize Separate states so you can reason about them Step 2: triage What are the relative values of each case i.e. p(call) * count Step 3: reduce waste
  • 184. (back of the envelope read cost) ~200 cycles x 2 x count
  • 185. (back of the envelope read cost) ~200 cycles x 2 x count ~2.28 count per 200 cycles = ~88
  • 186. (back of the envelope read cost) ~200 cycles x 2 x count ~2.28 count per 200 cycles = ~88 t = 2 * cross(q.xyz, v) v' = v + q.w * t + cross(q.xyz, t)
  • 187. (back of the envelope read cost) ~200 cycles x 2 x count ~2.28 count per 200 cycles = ~88 t = 2 * cross(q.xyz, v) v' = v + q.w * t + cross(q.xyz, t) (close enough to dig in and measure)
  • 188. Apply the same steps recursively…
  • 189. Apply the same steps recursively… Step 1: organize Separate states so you can reason about them Root or not; Calling function with context can distinguish
  • 190. Apply the same steps recursively… Step 1: organize Separate states so you can reason about them Root or not; Calling function with context can distinguish
  • 191. Apply the same steps recursively… Step 1: organize Separate states so you can reason about them
  • 192. Apply the same steps recursively… Step 1: organize Separate states so you can reason about them Can’t reason well about the cost from…
  • 193. Step 1: organize Separate states so you can reason about them
  • 194. Step 1: organize Separate states so you can reason about them Step 2: triage What are the relative values of each case i.e. p(call) * count Step 3: reduce waste
  • 195. Good News: Most problems are easy to see.
  • 196. Good News: Side-effect of solving the 90% well, compiler can solve the 10% better.
  • 197. Good News: Organized data makes maintenance, debugging and concurrency much easier
  • 198. Bad News: Good programming is hard. Bad programming is easy.
  • 199. While we’re on the subject… DESIGN PATTERNS: http://realtimecollisiondetection.net/blog/?p=81 http://realtimecollisiondetection.net/blog/?p=44 “