Next | Making Programs Faster | 49 |
Back to the MFA
The profiler says that main::letter_histogram is consuming most of the CPU time
%Time ExclSec CumulS #Calls sec/call Csec/c Name
63.7 0.830 0.829 109 0.0076 0.0076 main::letter_histogram
13.8 0.180 0.180 1 0.1800 0.1800 Mail::Util::read_mbox
A 20% speedup in this one function would reduce the program's run time by 1/8
sub letter_histogram { my $strdex = (length $_[0])-1; $letter_hist{substr($_[0],$_,1)}++ for (0..$strdex); }
Not much to work with here
I tried a bunch of things I thought of and some the test audiences suggested
No luck
Some of these things are in the Bonus Section at the end
Next | Copyright © 2003 M. J. Dominus |