Optimizing == important.
But often: Readable code == more important
Learn what your compiler does,Then let the compiler do it.
If you do an optimization, test it on real world data.
If it’s not drastically faster but makes the code less readable: undo it.
转载自State of the art C compiler optimization tricks。