Matt Godbolt, creator of the popular compiler explorer, is writing an advent calendar style series on various optimizations modern compilers do when they generate machine code. There's also an...
Matt Godbolt, creator of the popular compiler explorer, is writing an advent calendar style series on various optimizations modern compilers do when they generate machine code. There's also an accompanying video series on youtube, but it covers the same material. Here's a link to the latest video as of today.
There is an old blog post that really opened my eyes to this subject. Trying to dig the exact post up proved troublesome, but it blew my mind that a division by a constant could be turned into a...
There is an old blog post that really opened my eyes to this subject. Trying to dig the exact post up proved troublesome, but it blew my mind that a division by a constant could be turned into a wrapping multiplication by constant.
It really put to rest my idea that assembly was necessarily faster than compiled languages. Sure, it can be...if you know better than the compiler in some specific case. But over the course of an entire program, it seems like a poor bet to think one could outdo the accumulated knowledge of deacdes of compiler-writer optimizations.
Matt Godbolt, creator of the popular compiler explorer, is writing an advent calendar style series on various optimizations modern compilers do when they generate machine code. There's also an accompanying video series on youtube, but it covers the same material. Here's a link to the latest video as of today.
There is an old blog post that really opened my eyes to this subject. Trying to dig the exact post up proved troublesome, but it blew my mind that a division by a constant could be turned into a wrapping multiplication by constant.
It really put to rest my idea that assembly was necessarily faster than compiled languages. Sure, it can be...if you know better than the compiler in some specific case. But over the course of an entire program, it seems like a poor bet to think one could outdo the accumulated knowledge of deacdes of compiler-writer optimizations.