Don't trust compiler and optimize yourself
I'm writing this question inspired by this question. That question shows
that in some cases mathematical optimization may prevent some stuff work
much faster.
So I want to create thread where people could look for ways to optimize
some calculations, share their knowledge about this stuff. Because even
modern compilers don't include optimizations in some cases, yet.
Also, for people who are going to use some code from answers, decide if
you really need this because:
Your code will be hard to read and modify.
Even minor changes may become hard to reach.
Developers of compilers always adding new stuff, so in some cases code
from answer may not be as fast as compiler optimized code because of
latest optimizations.
Also I want to note, that in most cases we need to trust compiler, it is
just a title :)
No comments:
Post a Comment