- Code level optimizationsuch as1. Optimize function calls-
use fast call, which doesn't use the stack but uses some processor
registers. This is limited only when the parameters are not greater than
2. Optimize repeated callsUse inline functions and macros instead of calling functions for small procedures, which abuse the stack.3. Allocate memory all at onceinstead of re-allocating memory each time you add an element.4. Use objects instead of heap pointers as much as you can.5. Be wise in using loops.