Optimizations in C++ compilers: a practical journey

(queue.acm.org)

38 points | by fanf2 6 days ago ago

1 comments

  • macgyverismo 10 hours ago ago

    Lovely article, I am amazed at the lengths compilers go through to get the best performance. Thanks for writing this!

    Reading the part about pure functions (including the extension [[gnu::pure]]) made me feel that this is a part where the C++ default is actually wrong. Not just because it could be better/hindsight/other languages have it/etc. but because it is in conflict with its own motto, don't pay for what you don't use. I really hope I can enable a compiler flag some time in the future that would make my variables const, and my functions pure by default.