Why performant code matters (but gets widely ignored), with Casey Muratori
· Summarized
Key takeaways
- Performance should be integrated into the earliest stages of software design and architecture, as optimizing after the fact is costly and often ineffective.
- Reading assembly language and understanding CPU internals empower developers to diagnose performance issues and optimize effectively.
- Good software architecture involves designing systems with future optimization in mind, avoiding patterns that hinder compiler improvements and parallelization.
- The demand for rapid game development has shifted from engine rebuilding to leveraging commercial game engines, but this has increased market saturation and competition.
- AI tools are still in early adoption phases; their impact on productivity and quality is promising but not yet transformative, and developer autonomy plays a critical role in how AI affects motivation.
- Deep technical understanding, skepticism of received practices, and curiosity are core traits of excellent software engineers.
Summary
The Importance of Performance in Software Development
Casey Muratori emphasizes that despite overwhelming evidence of performance's critical role in software efficiency and cost, the industry largely neglects it. He discusses how most software runs significantly slower than necessary—by 10 to 100 times—and why this neglect persists due to misconceptions, architectural decisions, and a historical focus on rapid feature delivery over optimization. Casey advocates for integrating performance considerations into early design phases and measuring the theoretical limits of hardware to better target optimizations.
Learning to Read Assembly and Understanding CPUs
A key theme Casey advocates is for developers to learn how to read assembly language to understand what their code actually does at the hardware level. He explains how this skill reveals why high-level languages like Python are much slower compared to C or Rust—because of vastly different assembly instructions. Casey stresses that understanding CPU internals, including data movement, instruction flow, and execution units, enables developers to make informed decisions about architecture and optimize effectively. He notes that assembly is simpler than many believe and essential for performance tuning.
Designing Software for Optimization and Architectural Decisions
Casey discusses the importance of architectural choices in software development, stressing that good design should account for future optimization. He criticizes dogmatic practices such as excessive modularization or virtual functions that hinder compiler optimizations. Instead, he advocates for a pragmatic approach: understanding the hardware, minimizing serial dependency chains, and structuring code to keep performance bottlenecks identifiable and fixable later. Casey highlights how architectural decisions—like avoiding unnecessary serialization—are vital for scalable, high-performance systems.
The Evolution and Challenges of Game Development
Casey reviews how game development has shifted from individual studios building their engines from scratch to leveraging commercial game engines like Unreal and Unity, making game creation more accessible. He explains that historically, issues like engine risk and gameplay uncertainty led studios to rapid prototyping and vertical slices, enabling them to refine core gameplay early. He notes that modern live service games extend development cycles and market saturation increases, making discoverability challenging. Casey also discusses how the industry’s emphasis on cutting-edge graphics and multiplayer experiences drives long development timelines, exemplified by titles like GTA 6.
Impact of Industry Changes, Engines, and AI on Development
The podcast explores how access to powerful engines and AI tools influences the industry. Casey points out that while engines like Unreal reduce entry barriers and boost creativity, they also contribute to market flooding, where outstanding games struggle to stand out without marketing. Regarding AI, Casey notes that it’s still early to assess its full impact. He observes that AI tools are primarily used as augmentation rather than automation, and that full AI-driven development may still be years away. Casey warns that AI fatigue is emerging among developers, especially those with less autonomy, who feel their skills are devalued and their motivation diminishes.
Traits of an Excellent Software Engineer and Good Coding Practices
Casey emphasizes curiosity and a deep understanding of hardware—such as CPU architecture and assembly language—as marks of a great developer. He criticizes dogmatic coding practices, highlighting how certain habits like excessive small functions or virtual calls can degrade performance by preventing compiler optimizations. He advocates for skepticism of received wisdom, relying on measurable, empirical evidence. Good coders should aim for simplicity, transparency, and maintainability, enabling hardware-aware optimizations and future improvements.
The Role of Automation, AI, and the Future of Coding
While acknowledging AI’s rising presence, Casey prefers traditional handcrafting and deep knowledge, viewing AI as a tool to enhance, not replace, craftsmanship. He draws parallels to traditional craft industries, emphasizing that some aspects of software and hardware creation are fundamental human activities. Casey discusses the psychological impacts, including burn-out and loss of motivation, caused by AI fatigue and organizational pressures. He suggests that autonomy in work fosters better AI integration and creativity rather than control through mandates.
Sponsors
- Antithesis · Verify your system’s correctness without human review or traditional integration tests – and avoid bugs or outages.
- Sentry · Application monitoring software considered “not bad” by millions of developers. Use Sentry to monitor, diagnose, and fix errors and performance issues in your applications.
- TurboPuffer · A vector and full-text search engine built on object storage. It’s fast, cheap, and extremely scalable. Ideal for data-heavy systems to reduce latency and improve performance.
Show notes
Brought to You By:
• Antithesis – verify your system’s correctness without human review or traditional integration tests – and avoid bugs or outages.
• Sentry – application monitoring software considered “not bad” by millions of developers.
• turbopuffer– a vector and full-text search engine built on object storage. It’s fast, cheap, and extremely scalable.
—
There can be few people around who care about software performance more than today’s pod guest, Casey Muratori. He’s a programmer and videogame developer, founder of Molly Rocket, and creator of Handmade Hero – a long-running series about building a game from scratch. He also evangelizes about performance on his Substack, Computer, Enhance.
We got to know each other about three years ago, first via messages, including this one from Casey:
“Why does the industry zeitgeist place so little emphasis on software performance when there seems to be overwhelming evidence that performance is critical to their bottom line?
Like you, I run a Substack for professional programmers, but I focus exclusively on software performance. Although we are quite large by Substack standards, so a certain subset of programmers must believe performance is important, I nonetheless hear lots of dismissive excuses when I post on social media. This happens so frequently, I devoted an entire article to cataloging the extensive pro-performance evidence we already have from the world's leading software companies: Performance Excuses Debunked.
Strangely, nobody has a rebuttal to why performance is important. When I point people to this, they actually tend to agree. But the prevailing attitude nonetheless stays the same.”
I’m delighted we finally have Casey on the podcast because it’s overdue! In this episode, we discuss why software performance matters, why it’s overlooked, and how developers can get better at writing performant code. We explore why performance should be considered during design, the value of learning to read assembly & understanding how CPUs work, Casey’s critique of ‘clean code’, and why he believes testing shouldn't drive software design.
We touch on how videogame development has changed, and influential game engines. Casey also tells us why he prefers to write code by hand, not with AI, and more.
—
Timestamps
00:00 Intro
05:17 Games at Microsoft
12:52 Building games
16:00 Why performance matters
27:12 Why you should learn to read assembly
30:36 Designing for optimization
42:51 How to get better at writing performant software
49:04 Understanding how the CPU works
55:53 Building games then and now
1:05:56 How game engines changed building games
1:10:48 Why new games compete with old games
1:13:25 GTA 6: why is it taking so long?
1:16:59 Casey’s critique of clean code
1:21:48 Casey’s take on TDD
1:24:30 What is good code?
1:27:32 What makes a good software engineer?
1:33:56 Why Casey doesn’t code with AI
1:39:01 AI’s impact on the game industry
1:44:43 AI and burnout
1:50:21 Why you should read papers
—
The Pragmatic Engineer deepdives relevant for this episode:
•Pushing software engineering limits with “napkin math”withSimon Eskildsen
•How Games Typically Get Built: prototyping, game engines, and a different type of QA
•Game Development Basics: deepdive on how game studios differ from standard software teams
•Inside Linear's Engineering Culture: building a performant product with a tiny team
•Building a best-selling game with a tiny team – with Jonas Tyroller. A two-person team built a game that sold 1M+ copies
More on premature optimization: read or watch Casey’s extended take on “premature optimization is the root of all evil”: https://www.computerenhance.com/p/theroot
—
Production and marketing by https://penname.co/. For inquiries about sponsoring the podcast, email podcast@pragmaticengineer.com.
Get full access to The Pragmatic Engineer at newsletter.pragmaticengineer.com/subscribe
Follow this show on AudioBrevity and new episodes get summarized for you. Create a free account