Bytes before FLOPS: your algorithm is (mostly) fine, your data isn't

https://news.ycombinator.com/rss Hits: 8
Summary

Written by David Mili膷evi膰 on November 23, 2025 Bytes before FLOPS: your algorithm is (mostly) fine, your data isn't A small, but deep dive into performance and data-oriented optimization. Foreword So, earlier this year I did a presentation at a cool(get it?) little Norwegian company called Airthings. It was a two-parter. First part was how the compilation pipeline works - from ASCII to assembly, greatly simplified of course. It was from an old presentation I did many years ago. The second part is the interesting. It's about performance and what are some of the low-hanging fruits that you can pick off to speed up stuff as much as possible. Now, that part actually takes a while, but in short it's basically a distillation of my experience working on compilers, assembly and writing vectorized code. The gist of it is - data. It occurred to me that a small summary would make a good blog post. There's plenty of material on data-oriented design and performance, but this might be a nice overview. I'll style it as a written representation of how I approach optimization. When I approach an optimization effort, first thing I do is I try to visualize the data, where each bit is going from and to, what operations are being done, what's the difference between the initial and final state, can we get there with fewer or simpler steps? If the data is coming in in a suboptimal form, transform it. There is no algorithm in the world that will save you from inefficiently coded information. Usually the steps, in my experience, go like this: 1. Profile Before anything else, profile. Sometimes you can intuit where the bottleneck is, but most of the time, you would be surprised at the real place the algorithm falls apart. Sometimes it won't be a single bottleneck, maybe it'll be spread out over multiple places (worst case scenario being the flat profile where program time is roughly evenly distributed). A lot of it depends on not only understanding low-level programming but the domain that ...

First seen: 2025-11-24 23:23

Last seen: 2025-11-25 06:24