1 . | Create a baseline by doing a plain compile with profiling on and analyzing it. |
2 . | Turn on the base level of optimization for your compiler (still profiling). |
3 . | Measure again, and identify the bottlenecks in your program. |
4 . | Tune the bottlenecks and measure. Remove tuning that doesn''t help, as measured through profiling. |
5 . | Turn on the next level of compiler optimization. |
6 . | Repeat from Step 3. |