Next | Making Programs Faster | 154 |
%Time ExclSec CumulS #Calls sec/call Csec/c Name
63.7 0.830 0.829 109 0.0076 0.0076 main::letter_histogram
This is a typical situation
Often, a program is structured as a series of nested loops
For example, this program:
For each input file,
For each message in the file,
For each character in the file
Append it to the histogram.
The code inside the innermost loop gets run many, many times
Here, once for each character in the entire input
Other parts of the program are run much less frequently
A small speedup in this innermost loop can have a disproportionate effect on run time
Next | Copyright © 2003 M. J. Dominus |