Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Optimizations in C++ compilers: a practical journey (acm.org)
38 points by fanf2 8 days ago | hide | past | favorite | 2 comments




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.


(2019) Popular in 2020 (102 points, 20 comments) https://news.ycombinator.com/item?id=23822044



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: