Problem Solved!!! :)

Thanks for every one of you perl Experts.. i've learnd alot from this.

Bruce Hudson wrote:

You are under a very basic misunderstanding. This is a trace of the
EXECUTION of your script, not the compilation/loading. From the earlier
messages you sent in, you are calling "Switch::filter_blocks", which I
am not familiar with but presumably reads switch configuration files. It
uses the "Text::Balanced" packages to parse those, not your script.

Stop looking at the loading of your program becauase it is not broken.
Look at what it is doing. The profile showed you ran "Switch::filter_blocks"
126 times. Do you need to parse all of those config files off the top? Can
you defer THAT?


Bill Luebkert wrote :

My suggestion would be to remove the use Switch and recode the cases
using ifs.

I've replaces all the "Switch" occurences in the script to 'if's' and removed the Use Switch.
Here are the results:

dprofpp tmon.out
File::Glob::GLOB_TILDE has 1 unstacked calls in outer
File::Glob::GLOB_BRACE has 1 unstacked calls in outer
Exporter::export has -5 unstacked calls in outer
File::Glob::GLOB_QUOTE has 1 unstacked calls in outer
File::Glob::GLOB_NOMAGIC has 1 unstacked calls in outer
File::Glob::AUTOLOAD has -5 unstacked calls in outer
Exporter::Heavy::heavy_export has 5 unstacked calls in outer
File::Glob::GLOB_ALPHASORT has 1 unstacked calls in outer
Total Elapsed Time = 3.435482 Seconds
  User+System Time = 1.105482 Seconds   (used to be 25 !!)
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c  Name
 17.1   0.190  0.357      9   0.0211 0.0396  Spreadsheet::WriteExcel::Workbook:
                                             :BEGIN
 14.4   0.160  0.743      8   0.0199 0.0929  main::BEGIN
 7.24   0.080  0.079     10   0.0080 0.0079  Spreadsheet::WriteExcel::Worksheet
                                             ::BEGIN
 5.43   0.060  0.416      4   0.0150 0.1041  Spreadsheet::WriteExcel::BEGIN
 4.43   0.049  0.068      1   0.0493 0.0676  Config::IniFiles::ReadConfig
 3.62   0.040  0.049      6   0.0066 0.0082  File::Copy::BEGIN
 3.62   0.040  0.049      5   0.0080 0.0098  IO::Seekable::BEGIN
 3.62   0.040  0.038      7   0.0057 0.0055  File::Copy::copy
 2.17   0.024  0.040    188   0.0001 0.0002  Config::IniFiles::val
 1.81   0.020  0.020      5   0.0040 0.0040  Exporter::as_heavy
 1.81   0.020  0.030      2   0.0100 0.0148  POSIX::BEGIN
 1.81   0.020  0.020      5   0.0040 0.0040  Exporter::export
 1.81   0.020  0.020      7   0.0028 0.0028  File::Path::BEGIN
 1.81   0.020  0.049      5   0.0040 0.0098  File::Remove::BEGIN
 1.81   0.020  0.078      5   0.0040 0.0157  Spreadsheet::WriteExcel::OLEwriter
                                             ::BEGIN


Thanks again to everyone!

P.S : why using Switch has so bad performance in Perl ?

_______________________________________________
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to