11.7. The GNU Profiler: gprofIt's often handy to be able to see where a program is spending its time. For example, if a greater-than-expected amount of time is being spent in a particular function, it might be worth optimizing the function by hand for better performance. The gprof utility allows you to obtain a program's profile (Figure 11-15).
Here's an example of gprof in action: $ main2 ...execute the program. palindrome ("cat") = 0 ...program output. After a profile has been viewed, you may decide to do some hand tuning and then obtain another profile. |