Optimization is a process of making trade-offs—sacrificing one quality of code for another desirable quality. Describe the kinds of trade-offs that lead to a performance increase.
The kinds of decisions that profoundly influence a program's performance are:
Number of features versus size of code
Program speed versus memory consumption
Storage and caching versus computation on demand
Guarded approach versus unguarded; optimistic versus pessimistic
Approximate calculations versus exact calculations
Inline versus function call; monolithic versus modular
Indexing an array versus searching a list
Passing a parameter by reference or address versus passing a copy
Implemented in hardware versus software
Hard-coded, direct ...