Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 6

Code Optimization

Techniques
Outline
Introduction to optimization
Code optimization strategy
Standard techniques list
Code optimization summary
Introduction
Optimization generally focussed on improving
just one or two aspects of performance:
execution time
memory usage

disk space

Bandwidth

power consumption or some other resource.

Need for program optimization


Code optimization - best approach
High level code optimization
Low level code optimization
Code optimization strategy
Code optimization - when to begin
Detailed optimization should not be started
before developer completes an initial version of
the code.
Code optimization - where to begin
Identify the parts of the application or program
executed more frequently or which consume
more execution time.
Standard techniques
list
Common sub-expression/ Code grouping.
Unrolling loop.
Functional optimization
Avoid unused variables and parameters
Finding/Selection of effective algorithms.
Code optimization
summary
The time taken to undertake optimization should be carefully
decided.
Optimizing existing code usually does not add new features.
Be sure to ensure that no new bugs are added during
optimization.
Readability should not be lost after optimizing the
unoptimized code.
Maintainability should not be impacted after optimizing the
unoptimized code.
Be careful when optimizing large programs that already
work without bugs.

You might also like