Simple Code, High Performance
Why Hacker News recommends it
HN people recommend it to anyone wanting a practical sense of what CPUs can really do and why abstraction layers cost so much performance.
What it is
Casey Muratori's University of Twente guest lecture is a case study in how straightforward code can cut thousands of lines and tens of seconds of runtime down to a few dozen lines running in under a second. It uses concrete examples to show why software is often an order of magnitude slower than it should be.
Recommended by 6 HN commenters across 6 different months, 2021 to 2025.
What Hacker News said
Strong rec DrBazza · 2021-11 · on “An Epic future for SPJ”
> Speak for yourself; most phones I see still take 2+ seconds to open some apps. Why is that though? I've written code since the 8 bit days of BBC micros and ZX Spectrums. Casey Muratori's (who has been on here a lot lately) talk nails it [1] - developers just don't realise how fast their code could and should run. And the fact that we have layers upon layers of frameworks and no one cares. [1] [this video]
Strong rec mrv_asura · 2022-03 · on “Algorithms for Modern Hardware”
The timing of this is great! I just watched Casey Muratori's lecture, "Simple Code, High Performance"[1] and its follow-up videos[2, 3]. I highly recommend watching it. It is about Software Optimization, and gives practical and high-level understanding of topics like CPU Architecture, SIMD etc. [1] [this video] [2] [LINK] [3] [LINK]
Strong rec Pr0ject217 · 2022-12 · on “What we can learn from vintage computing”
Thank you for the detailed explanation! It sounds like programming computers back then would have been a joy. Casey Muratori's talks[0] on performance and optimization sparked an interest in me to start putting thought into what the CPU actually does (which wasn't taught when I learned web development). Since discovering his talks, I've been on the hunt for more learning materials. [0] [this video]
Recommends ocharles · 2021-12 · on “Why can’t you design noise in frequency space?”
For one real application of blue noise in particular, see [this video] (22:30 is a good starting point). Here Casy explains a grass planting algorithm for games, where white noise wouldn't be suitable.
Recommends mtzet · 2024-03 · on “Ask HN: How can I learn about performance optimization?”
Most software in the industry is slow because it's doing a lot of stuff that it shouldn't. Often times additional "optimization" layers adds caching, but makes getting to the root of the issue harder. The biggest win is primarily getting rid of things you don't need and secondarily operating on things in batch. My playbook for optimizing in the real world is something like this: 1. Understand what you're actually trying to compute end-to-end. The bigger the chunk you're trying to optimize, the greater the potential for performance. 2. Sketch out what an optimal process would look like. What data do you need to fetch, what computation do you need to do on this, how often does this need to hap
Recommends kleiba · 2024-11 · on “I Waited 10B Cycles and All I Got Was This Loading Screen”
Casey Muratori started a whole educational webseries about this - the fact that hardware is getting faster and faster but the user experience seems to be staying the same. [this video] He also has a "performance-aware programming" series: [LINK]
Cites rasz · 2021-11 · on “Ask HN: How were video games from the 90s so efficient?”
There are no tricks, you just have to give up mountains of levels of abstraction accumulated over the years. [this video]
Cites iamwil · 2021-12 · on “Why can’t you design noise in frequency space?”
Blue noise is useful in games for generating more natural looking scenes. Here's an example of how to algorithmically place grass in the game "The Witness". [this video] So if you use white noise, it looks unnaturally clustered with patches. This is the part that discusses the noise. [this video]