I really appreciate that despite being an obvious domain expert, he’s starting with the simple stuff and not jumping straight into crazy obscure parts of the x86 instruction set
I am personally interested in the code amalgamation technique that SQLite uses[0]. It seems like a free 5-10% performance improvement as is claimed by SQLite folks. Be nice if he addresses it some in one of the sessions.
I hope he ends up covering integer division by constants. The chapter on this in Hacker's Delight is really good but a little dense for casual readers.
I'm looking forward to the remaining posts. The first thing I did this AM was teach SBCL how to optimize `(+ base (* index scale))` and `(+ base (ash index n))` patterns into single LEA instructions based on the day 2 learnings.
Matt is amazing. After checking out his compiler optimizations, maybe check out the recent interview I did with him.
What I’ve come to believe is this: you should work at a level of abstraction you’re comfortable with, but you should also understand the layer beneath it.
If you’re a C programmer, you should have some idea of how the C runtime works, and how it interacts with the operating system. You don’t need every detail, but you need enough to know what’s going on when something breaks. Because one day printf won’t work, and if the layer below is a total mystery, you won’t even know where to start looking.
So: know one layer well, have working knowledge of the layer under it, and, most importantly, be aware of the shape of the layer below that.
17 comments
[ 3.2 ms ] story [ 44.0 ms ] threadMany thanks to him for that.
Between that and compiler explorer, it is fair to say he made the world a better place for many of us, developers.
where is the problem to be solved?
[0] https://sqlite.org/amalgamation.html
Also this article in acmqueue by Matt is not new at all, but super great introduction to these types of optimizations.
https://queue.acm.org/detail.cfm?id=3372264