It's very important... not to do that.
There are a few reasons:
- Readability is very important.
- Most of the time, only a small part of the project has any real impact on performance.
- You need to measure to optimize things, especially micro optimizations. It's easy to have ideas about what'd be faster, but surprisingly often it has no or negative effect.
- If you've developed readable code with passing unit tests first, it's much easier to safely optimize parts safely.
There are exceptions (3% according to Donald Knuth). For example, implementing a different algorithm with better runtime complexity if you think it'll be critical. In such a case, optimizing it later may be a complete rewrite. But then that's not really a micro-optimization.