had modified the program it ran in only few hoursand he finished his thesis on time while not nearly so important as changing an algorithm to reduce its growth rate"code tuningcan also lead to dramatic improvements in running time code tuning is the art of hand-optimizing program to run faster or require less storage for many programscode tuning can reduce running time by factor of tenor cut the storage requirements by factor of two or more once tuned critical function in program -without changing its basic algorithm -to achieve factor of speedup to get this speeduphoweveri did make major changes in the representation of the informationconverting from symbolic coding scheme to numeric coding scheme on which was able to do direct computation here are some suggestions for ways to speed up your programs by code tuning the most important thing to realize is that most statements in program do not have much effect on the running time of that program there are normally just few key subroutinespossibly even key lines of code within the key subroutinesthat account for most of the running time there is little point to cutting in half the running time of subroutine that accounts for only of the total running time focus your attention on those parts of the program that have the most impact when tuning codeit is important to gather good timing statistics many compilers and operating systems include profilers and other special tools to help gather information on both time and space use these are invaluable when trying to make program more efficientbecause they can tell you where to invest your effort lot of code tuning is based on the principle of avoiding work rather than speeding up work common situation occurs when we can test for condition that lets us skip some work howeversuch test is never completely free care must be taken that the cost of the test does not exceed the amount of work saved while one test might be cheaper than the work potentially savedthe test must always be made and the work can be avoided only some fraction of the time example common operation in computer graphics applications is to find which among set of complex objects contains given point in space many useful data structures and algorithms have been developed to deal with variations of this problem most such implementations involve the following tuning step directly testing whether given complex object contains the point in question is relatively expensive insteadwe can screen for whether the point is contained within bounding box for the object the bounding box is simply the smallest rectangle (usually defined