Coding optimizations are local in scope and do not necessitate understanding of overall program design. This is a good place to start when you join an ongoing project whose design you don't yet understand.
The fastest code is the one that's never executed. Try the following to bail out of a costly computation:
Are you ever going to use the result? It sounds silly, but it happens. At times we perform computation and never use the results.
Do you need the results now? Defer a computation to the point where it is actually needed. Premature computations may never be used on some execution flows.
Do you know the result already? We have seen costly computations performed even though their results were available two lines above. If you already ...