Review


Know the Concepts

  • At what level of importance is optimization compared to the other priorities in programming?

  • What is the difference between local and global optimizations?

  • Name some types of local optimizations.

  • How do you determine what parts of your program need optimization?

  • At what level of importance is optimization compared to the other priorities in programming? Why do you think I repeated that question?

Use the Concepts

  • Go back through each program in this book and try to make optimizations according to the procedures outlined in this chapter

  • Pick a program from the previous exercise and try to calculate the performance impact on your code under specific inputs. [2]

Going Further

  • Find an open-source program that you find particularly fast. Contact one of the developers and ask about what kinds of optimizations they performed to improve the speed.

  • Find an open-source program that you find particularly slow, and try to imagine the reasons for the slowness. Then, download the code and try to profile it using gprof or similar tool. Find where the code is spending the majority of the time and try to optimize it. Was the reason for the slowness different than you imagined?

  • Has the compiler eliminated the need for local optimizations? Why or why not?

  • What kind of problems might a compiler run in to if it tried to optimize code across function call boundaries?

[2]Since these programs are usually short enough not to have noticeable performance problems, looping through the program thousands of times will exaggerate the time it takes to run enough to make calculations.




Programming from the Ground Up
Programming from the Ground Up
ISBN: 0975283847
EAN: 2147483647
Year: 2006
Pages: 137

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net