Should we still be optimizing “in the small”?

后端 未结 22 2092
旧时难觅i
旧时难觅i 2020-12-05 11:32

I was changing my for loop to increment using ++i instead of i++ and got to thinking, is this really necessary anymore? Surely today\'s compilers

22条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-05 11:42

    Certainly yes, because the compiler needs more resources to optimize not optimized code than to optimize something already optimized. In particular, it causes the computer to consume a little bit more energy, that, despite being small, still causes bad impact on the already hurt nature. This is especially important for open-source code, which is compiled more often than closed source.

    Go green, save the planet, optimize yourself

提交回复
热议问题