Matt Godbolt’s blog
Matt Godbolt — Creator of Compiler Explorer, C++ developer at Hudson River Trading
Creator of Compiler Explorer. Deep dives into compilers, C++, and low-level optimization.
xania.orgMatt Godbolt created Compiler Explorer — the tool that lets you see what your code actually compiles to — and his blog brings that same "let's look under the hood" energy to everything he writes. Posts dissect compiler optimizations, CPU microarchitecture, and the surprisingly clever tricks that modern compilers pull off, all explained with real code and genuine wonder at the machinery beneath it.
Written by Matt Godbolt since 2007.
Very Active
Publishes multiple times per week
1
Independent Blog
English
How this blog's content is accessed through Blogs Are Back.
Full Content
RSS feed includes complete post content for reading in-app
Proxy Required
Feed is fetched through our proxy for browser compatibility
Proxy Post Links
Post pages are loaded through our proxy for compatibility
Embeddable
Posts can be displayed inline in the reader view
Recent posts from Matt Godbolt’s blog's RSS feed.
2025 in Review
Written by me, proof-read by an LLM. Details at end.2025 has been quite a year for me. The big ticket things for me were having the majority of the year on a non-compete, a new job, and some videos and conference talks.It was a bumper year for my public talks, which included:I also appeared in a number of :Computerphile videosOn the front, I finally solved a three-year-old problem with — our new content-addressable filesystem that mounts compiler images on demand instead of all 2,000+ at boot...
Thank you
Written by me, proof-read by an LLM. Details at end.It's the 25th! Whatever you celebrate this time of year, I wish you the very best and hope you are having a lovely day. For me, this is a family time: I'm not at all religious but was brought up to celebrate Christmas. So, today we'll be cooking a massive roast dinner and enjoying family time.1This series was an idea I had around this time last year, and it has been a substantial amount of work. I've really enjoyed writing it, and seeing the im...
When compilers surprise you
Written by me, proof-read by an LLM. Details at end.Every now and then a compiler will surprise me with a really smart trick. When I first saw this optimisation I could hardly believe it. I was looking at loop optimisation, and wrote something like this simple function that sums all the numbers up to a given value:So far so decent: GCC has done some preliminary checks, then fallen into a loop that efficiently sums numbers using (we've ). But taking a closer look at the loop we see something unu...
Switching it up a bit
Written by me, proof-read by an LLM. Details at end.The standard wisdom is that switch statements compile to jump tables. And they do - when the compiler can't find something cleverer to do instead.Let's start with a really simple example:Here the compiler has spotted the relationship between and the return value, and rewritten the code as: - pretty neat. No jump table, just maths!xif (x < 5) return (x+1) * 100; else return 0;If we mix up the code a bit so there's no obvious relationship be...
Clever memory tricks
Written by me, proof-read by an LLM. Details at end.After exploring SIMD vectorisation over the last of , let's shift gears to look at another class of compiler cleverness: memory access patterns. String comparisons seem straightforward enough - check the length, compare the bytes, done. But watch what Clang does when comparing against compile-time constants, and you'll see some rather clever tricks involving overlapping memory reads and bitwise operations. What looks like it should be a call t...
If you enjoy Matt Godbolt’s blog, you might also like these blogs.
Random ASCII
randomascii.wordpress.comBruce Dawson (37-year industry veteran) on performance, debugging, and Windows internals.
Julia Evans
jvns.caApproachable explanations of Linux, networking, and debugging through zines and comics.
antirez
antirez.comSalvatore Sanfilippo, creator of Redis. Deep thoughts on programming, systems design, and software craft.
Adrian Courrèges
adriancourreges.comLegendary graphics studies dissecting DOOM, GTA V, and Metal Gear Solid V rendering pipelines.
Follow Matt Godbolt’s blog
If you've ever been curious about what the compiler actually does with your code — and why it sometimes does something better than you expected — Matt's blog will keep you fascinated.