Skip to content
0:00 / 0:00

#data-orienteddesign#cachefriendly#simd

CppCon 2014: Mike Acton "Data-Oriented Design and C++"

CppCon

189K subscribers • 103 videos on Hallway • Conference channel

YouTube
  • Recommended by 11 people: 9 on Hacker News, 1 on Lobsters and 1 in engineering communities.
  • A classic. People kept recommending it from 2014 to 2026.
  • Presented by Mike Acton, Engine Director at Insomniac Games
  • Linked in the descriptionCppCon/CppCon2014
  • An opinion. It argues one side of a question engineers disagree on.

Advanced. Deep dive for people who know the field.

862K views12 years ago11 recommendations

Software designSystems programmingData-oriented designC++Performance and optimization

Mike Acton argues that a program's sole purpose is transforming data and demonstrates how common C++ paradigms harm performance.

cppcon.org -- Presentation Slides, PDFs, Source Code and other presenter materials are available at: github.com/CppCon/CppCon2014 -- The transformation of data is the only purpose of any program. Common approaches in C++ which are antithetical to this goal will be presented in the context of a performance-critical domain (console game development). Additionally, limitations inherent in any C++ compiler and how that affects the practical use of the language when transforming that data will be demonstrated. -- Mike Acton: Engine Director, Insomniac Games -- Videos Filmed & Edited by Bash Films: BashFilms.com Work at Hudson River Trading (HRT): tinyurl.com/safxfctf

Why it's here

11 people recommend this

What people say. Highly recommended as a classic, must-watch talk on data-oriented design and memory-efficient programming.

Moments people linked to

u/bhbin r/Clojure • Recommends

Data-Oriented Design and C++

zengidon Hacker News • Recommends

On “Ask HN: What is your favourite tech talk?”

A lot of great talks already mentioned. Thought I'd add a gem from Mike Acton: Data-Oriented Design and C++ link to this video

iamcreasyon Hacker News • Recommends

On “Writing memory efficient C structs”

This reminds of an amazing talk by Mike Acton on Data oriented design: link to this video And there is a related talk by Andrew Kelley implementing these ideas on Zig toolchain: link

moregriston Hacker News • Recommends

On “Zed editor switching graphics lib from blade to wgpu”

…gh throughput systems. In terms of heroes, I’d place Mike Acton, Fabian Giesen 1, and Bruce Dawson 2 at the top of the list. All solid performance-oriented people who’ve taken real time to explain how they think and how you can think that way as well. I miss being able to listen in on gamedev Twitter circa 2013 before all hell broke loose. 0 link to this video 1 link 2 link…

friendlysockon Lobsters • Recommends

Data-Oriented Design and C++ The language is C++ and ASM, but the mindset is applicable to all languages. The Q&A at the end is also quite good.

friendlysockon Lobsters • Recommends

CppCon 2014: Mike Acton "Data-Oriented Design and C++" - YouTube

yoklovon Hacker News • Recommends

On “Ask HN: How do I become a faster programmer?”

…with what some people consider best practices. The resulting code tends to not be particularly object oriented, tends to have large functions, and tends to perform very well due to having a very small distance from what the code says to what actually needs to be executed by the processor. For more on this approach, see 0: link 1: link 2: link to this video…

harry8on Hacker News • Recommends

On “Asmttpd – Web server for Linux written in amd64 assembly”

Just because it's asm doesn't mean it's fast, sure. Just because it's C doesn't mean it's faster than an implementation in your favourite scripting language. Having said that, compilers do pretty badly on C-to-simd optimisation. The best you get is loop vectorization if it's really simple logic. You can usually get some pretty good wins there. The fact you lay out your memory for simd usually is a win all of its own due to cache prefetching even if you don't actually use any simd instructions. Compilers need heuristics to manage cache when you know what you're trying to do, (eg when should it use non-temporal writes, for example?) Fast C code is written while having a really clear mental mod…

cellularmitosison Hacker News • Recommends

On “Old box, dumb code, few thousand connections, no big deal”

A great talk which gets you thinking in this mindset is "Data-Oriented Design and C++" by Mike Acton link to this video As an example, if you are checking a boolean flag (1 bit) on an object, and it ends up being a cache miss (and x86_64 cache line size is 64 bytes), then your computer just went through all the expense of pulling in 512 bits from RAM yet it only used 1 of them. You are achieving 0.2% of the machine's possible throughput.

DeathArrowon Hacker News • Recommends

On “.NET Myths Dispelled”

…classes just to store data and use static methods. But the frameworks are OOP and there is no way around that unless you write your own frameworks. I am a big fan of Mike Acton's Data Oriented Architecture speeches, but I didn't find a way to implement something similar in C#. For those interested in something better than OOP, here's a few links: link to this video link link…

dxhdron Hacker News • Recommends

On “Data-Oriented Design Principles”

Mike Acton presented a great visualization of this in his 2014 DOD talk -- here's a link to just that clip: link to this video

mtzeton Hacker News • Recommends

On “Ask HN: How can I learn about performance optimization?”

…e are you? Are you doing a lot of I/O in the middle of the computation? Do you keep coming back to the same data? If you want to understand the limits of how fast computers are, and what optimal performance looks like I'd recommend two talks that come with a very different perspective from what you usually hear: 1. Mike Acton's talk at cppcon 2014 link to this video 2. Casey Muratori's talk about optimizing a grass planting algorithm link…

u/N-R-Kin r/C_Programming • Mentions

On “Misc of C Programming”

I do maintain a private list of articles/videos that I find useful. It's too messy to copy paste in it's entirety, so I'll pick out some of the good ones here: - Quick references: * https://en.cppreference.com/w/c (can be downloaded to be viewed offline as well!) * http://www.c-faq.com * https://port70.net/~nsz/c/ contains drafts of various C standards - Memory management: * Handles are the better pointer * Memory allocation strategies (some of the code shown are a bit over-engineered IMO, but the principle is good) * Untangling Lifetimes: The Arena Allocator - Concurrency: * Hardware memory model * Futexes are tricky * [C++ atomics, from basic to advanced. What do they really do…

u/Starcomberin r/compsci • Mentions

On “How does the CPU handle the relatively long wait times when they request something from DRAM?”

The stuff other people have said all help, but really, your CPU does indeed spend a lot of time just... waiting for data to arrive. Often they spend more time waiting for data than they spend working on it. Often when the data finally arrives, the ratio of relevant:irrelevant stuff is really low. Don't take my word for it. Check out this talk by Mike Acton, with the key parts to answer this question starting around 29 minutes in. For that exact reason, optimising video games is often not about making your logic more efficient, but instead about arranging your data more efficiently. For example, if you have a big chunk of data to work on, it's best to have it arranged in contiguous memory…
40View on Reddit

u/-not_a_knifein r/C_Programming • Mentions

On “Is C good enough for independent game development?”

…feel a bit like paint by numbers at first since I'm leaning on Raylib so heavily but it's fun and still challenging to get games working and off the ground. If you're committed to start from the very bottom and make everything, here are some resources I found: https://www.raylib.com/ https://handmadehero.org/ https://www.computerenhance.com/ [video [video https://www.gameenginebook.com/ There is a lot going on in these resources but these are the direction I want to work towards and you sound like you have a similar mindset. I'd like to point out that raylib is written in C and you can see in the examples how you could make a 2d or 3d game with it. My thoughts are that I would…

u/dechichiin r/C_Programming • Mentions

On “You guys asked me to compare my C animation system with Godot next. It did about 3x better than Unity.”

So after many years programming, and having used a lot of OOP, as well as having tried to apply principals from books like Clean Code, I mostly learned that this abstractions are a bad way to organize complex systems. I'm not the only engine programmer that thinks that, here's a short video were Casey explains how his first version of RAD's animation library was a mess due to the OOP design. For longer form arguments, I'd suggest this talk from Mike Acton and this presentation from Brian Will. That is not to say that you shouldn't think about high level system architecture, but the way I do those now do not use features like Inheritance hierarchies, interface, SOLID and stuff like th…