mcm has asked for the wisdom of the Perl Monks concerning the following question:
I have a series of Perl CGI scripts that intermittently are very slow. The same scripts have been in use for a long time on the same system with no problem, but this has started only recently -- and system traffic hasn't increased recently.
In investigating the problem I wrote the following test CGI to figure out which part of the CGI is taking the most time, and found that:
We're using Perl 5.00503 under Apache, without mod_perl.
What I'm looking for is some insight/speculation into why the interpreter might lag so much at the end of a BEGIN block.
BEGIN { $time1 = time; [ DO MISCELLANEOUS TASKS ] $time2 = time; unshift @INC, "$home/custom/lib"; $time3 = time; } $time4 = time; print "Content-type:text/html\n\n"; print "Begin Block: " . ($time3 - $time1) . "\n"; print " Miscellaneous Tasks: " . ($time2 - $time1) . "\n"; print " unshift inc: " . ($time3 - $time2) . "\n"; print "End begin block/begin main body: " . ($time4 - $time3) . "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Long delay at end of BEGIN block
by liz (Monsignor) on Sep 23, 2003 at 15:33 UTC | |
by mcm (Novice) on Sep 24, 2003 at 19:50 UTC | |
|
Re: Long delay at end of BEGIN block
by Elian (Parson) on Sep 23, 2003 at 15:37 UTC |