in reply to Long delay at end of BEGIN block

I'm not sure whether you realize that between "$time3" and $time4" your entire script is being compiled. Which can take long or short, depending on what modules you load and what they actually do.

So your delay could be from:

So without knowing what else you're loading in your script, there is no way we can tell what's wrong.

Liz

Replies are listed 'Best First'.
Re: Re: Long delay at end of BEGIN block
by mcm (Novice) on Sep 24, 2003 at 19:50 UTC

    Thanks for the insight -- I knew that BEGIN happened pre-compile, but I somehow wasn't connecting that with the module compilation.

    Anyway, I waited for another slow-time and tried the CGI again with different modules commented out, and narrowed it down to one module that seems to be the culprit.

    Now I just need to spend some time looking at the module to figure out why it sometimes takes so long to compile or initialize. A cursory glance showed that the module doesn't do much initialization (all of the logic is in the subs), except for setting some scalars to string values.

    The entire filesystem is stored locally (on a RAID array), so IO speed shouldn't be a factor. CPU or RAM might be a culprit -- our performance monitor doesn't show anything above 40%, but I suppose there could be mini-spikes that are shorter than the measurement period.