1. Avoid optimization if everything works well.
2. Avoid premature optimization. Typically, your cool optimized code will be look to the messy and understable. First write something that works by simple and clean code. And then optimize if needed.
3. Avoid optimization without benchmarks and profiling. When you found bottleneck replace or expand corresponding code. It will be easy with a good architecture. Otherwise, you risk "optimizing" a non-essential piece of code.
4. Optimization don't must destroy architecture, code style and readability. For exapmple "i*2" slower than "i << 1". But "i*2" is probably more understandable in the context of the code.
5. Avoid local optimization. Modern compilers will do all the work for you.
6. Reducing lines of code does not mean optimization.