Monday, February 22, 2010

Code Tuning Techniques

By team 4
0109803,0109829,0109833,0109845

Code tuning is basically a way of improving program's performance .It refers to changing the implementation of a design rather than changing the design itself.
An appealing reason for code tuning is that programmers see the software world from code's point of view. From that point of view, "better" code means better software. It is also appealing because mastering the art of writing efficient code is a rite of passage to becoming a serious programmer.

Optimization of code is done in two ways:
Improving Speed only:
  • Unrolling.
  • Unswitching.
  • Cache frequently used values.
  • Use sentinels in search loops etc.
Improving both Speed and Size:
  • Jam loops.
  • Pre-compute results.
  • Initialize data at compile time.
  • Substitute table lookups for complicated logic.
  • Use integers instead of floating point variables etc.
Our paper deals with each of these techniques in detail with an example.

If you want your program to be portable, techniques that improve performance in one environment can degrade it in others. If you change or upgrade compilers, the new compiler may automatically optimize code the way you were hand tuning it-your work will have been wasted. Even worse, your code tuning may defeat compiler optimizations that are designed to work with well-structured code.
Code tuning doesn’t always improve code readability, changes that you make are not meant to improve the internal structure of a software
No one but you and other programmers usually care how tight your code is. Nonetheless, within the programming culture, writing micro-efficient code proves you're cool !!

1 comment:

  1. Our Team members are
    0109803-Akshitha
    0109829-Mounika
    0109833-Nikhila
    0109845-Rupali

    ReplyDelete