in reply to Timing concerns on PerlEX/Mod_Perl

Try putting a

use Time::HiRes; warn "Begin: " . Time::HiRes::time;
at the beginning, and an analogous
warn "End: " . Time::HiRes::time;
at the end of the called portions of your script (if there are blocks that are called each time before and after execution, those would be ideal locations - not knowing what they are, if they exist, I cannot say) will at least give you a feel of how much the perl side is contributing to the delay.

There are quite a few points where things other than the Perl script contributes to the delay. Look at the time spent in Apache/IIS, the OS TCP/IP stack, and the client side of things as well. All things work together for the delay of those who write code.

--MidLifeXis

Replies are listed 'Best First'.
Re^2: Timing concerns on PerlEX/Mod_Perl
by Anonymous Monk on Jul 25, 2008 at 18:51 UTC
    Yes I did that already. My script takes 0.3 seconds average beginning to end. Which is fine, but when I LWP remotely and do a check. I get times from 2.5 seconds to 200 seconds(but in both cases script is still 0.3 seconds from beginning to end), also my ping seems same as google or around, so not a latency issue. (google.com LWPs for around 2.5 seconds). So if my code is taking only 0.3 seconds, I assumed it was IIS, so I swapped to Apache/ModPerl and am getting the same issue.

    I only have one script, which then loads preloaded html files and outputs them.It had a main namespace which has the output, and then a common name space where lal the common functions are stored and called. The output I'd say isn't that big, less then 30kb i'd say.

    I am not seeing anything strange in error logs
Re^2: Timing concerns on PerlEX/Mod_Perl
by shmem (Chancellor) on Jul 27, 2008 at 00:49 UTC
    All things work together for the delay of those who write code.

    Great. I stick that next to the map is posted at nearly every major street corner.

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}