Rules of Optimization

Optimization is a process of fine tuning your program or part of program to make it perform better in terms of time, memory or other resources.

  1. Time budgeting in hard real time systems like heart pacemakers.
  2. Constant attention approach where developer constantly looks for performance improvement at all times. Improving performance usually makes program harder to work with and slows down development. Optimizing all code equally and you will end up with 90 percent of the optimization waster, because you optimize code that isn’t run much.
  3. Performance improvement taking advantage of 90 percent statistic. Here you build the system and then run your program under a suitable profiler late in development phase and find hot spots. More often the top 10 percent of the hot spots determine 90 percent improvement in your system.
  4. And lastly for an effective optimization, it is a requirement that the code needs to be in refactored prior.