CS190
gprof assignment
April 17, 2001
Due Monday 4/30/01

The assignment

This assignment is intended to give you a chance to demonstrate that you know how to profile code and find performance bottlenecks.

Choose 5-10 methods from some component of your project. If you wrote code, use your code. Otherwise, pick any component you want, preferably aiming for one where performance will be important. Answer the following questions and record your answers before profiling.

1.
Before running gprof, make the following predictions:
2.
Predict where the hot spots will be in the code you've chosen, and explain why.
3.
Compile your code without any optimizations and profile it with gprof. Save the output from gprof and answer the questions below.
4.
EXTRA CREDIT: Compile your code with optimizations (either -O2 or -fast will work, but check the compiler man page for the differences) and then profile it again. Do the same tasks so that the results are comparable. Save the output from gprof and answer the last question below
5.
Analyze the output from both runs, and answer the following questions

Record the answers to the above questions (both pre- and post-gprof), and include a subset of your gprof output. Include the sections of the call graph profile and the lines from the flat profile which contain the functions mentioned in both your predictions and your analysis. If you did the optimized vs. unoptimized run, include excerpts from both runs, labeled appropriately. Specify which level of optimization you used.

Due

Due Monday, April 30.

Using gprof

Here is a brief summary of how to use gprof.

The O'Reilly book High Performance Computing by Kevin Dowd and Charles Severance has a section on interpreting the output from gprof. Or see a TA!



David Laidlaw, dhl@cs.brown.edu