Skip to content
0:00 / 0:00

#data-orienteddesign#cachefriendly#simd

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

CppCon

189K subscribers • 94 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/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/nwar1994in r/GraphicsProgramming • Mentions

using stl for graphics intensive apps bad? what are alternatives? I've seen a lot of presentations from video game companies claiming that they don't use stl. I'm guessing because they're slow. I feel there are some useful ones for example std::thread? std::atomic? [video What are alternatives? I also occasionally watch the end of the talk for QA to give myself a good laugh.
21View on Reddit

u/Ruskyin r/ProgrammingLanguages • Mentions

On “Alternatives to borrow checking?”

…lifetimes. In this context, Rust's zoo of standard library types is a distraction. You don't write beat C# by writing the same program but slathered in `Rc` and `RefCell` and `'a` to make the compiler accept it. You beat C# by carefully designing how you store your data to (among other things) minimize and simplify your use of memory allocation: link to this video Arenas are a nice simple example of this, but it doesn't stop there. This is a different paradigm, with its own approaches to solving problems. And for that matter, its own set of problems it sets out to solve in the first place! Which leads us to the next point: > all this rigidity and line noise is just to ensure what a language like Ha…

u/wtedstiOSin r/swift • Mentions

The case against object-oriented programming? So, there has been recently a rise of awareness about so-called "data-oriented programming" (those completely unfamiliar with the case can watch this and this talks). Swift is flexible enough to not enforce any single programming paradigm: you can do procedural, object-oriented, functional, declarative etc. Yet, I am curious: are there any teams and/or projects that have been following this trend and (e.g.) embraced the fact that massive view controllers are probably actually not so bad and that dependency injection frameworks are hurting much more than helping? Treat this thread as a survey: I am not trying to argue that one programming s…