permanentE has asked for the wisdom of the Perl Monks concerning the following question:
Here is the Devel::SmallProf output@cache = `cat filelist`; foreach $path (@cache) { open F, $path; while (<F>) { if (/hostname ([\-\w]+)/) { $hostname = $1; last; } } print "$hostname\n"; }
================ SmallProf version 0.9 ================ Profile of prof + Page 1 =============================================================== +== count wall tm cpu time line 0 0.000000 0.000000 1:#!/opt/CSCOpx/bin/perl 0 0.000000 0.000000 2: 1 0.000004 0.000000 3:$RUNDIR = "/var/adm/links/newrun"; 0 0.000000 0.000000 4: 0 0.000000 0.000000 5: 1 0.013885 0.010000 6:@cache = `cat $RUNDIR/filelist`; 0 0.000000 0.000000 7: 11600 0.059747 0.050000 8:foreach $path (@cache) { 11599 0.906185 0.080000 9: open F, $path; 284014 3.008497 1.210000 10: while (<F>) { 283652 3.195402 0.840000 11: if (/hostname ([-\w]+)/) { 11599 0.101677 0.060000 12: $hostname = $1; 11599 0.094969 0.040000 13: last; 0 0.000000 0.000000 14: } 0 0.000000 0.000000 15: } 11599 0.127013 0.050000 16: print $hostname." "; 0 0.000000 0.000000 17:}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: profiling help
by BrowserUk (Patriarch) on Apr 15, 2003 at 23:18 UTC | |
|
Re: profiling help
by l2kashe (Deacon) on Apr 16, 2003 at 00:42 UTC | |
|
Re: profiling help
by traveler (Parson) on Apr 15, 2003 at 23:21 UTC |