2-3 minutes is far too much (unless you are running Perl in and old C=64)!
Probably one of the modules you are using is doing something more that just being compiled. For instance, resolving some hostnames, trying to stablish some connection with a remote server, etc.
How is your CPU load over that 2-3 minutes?. Compiling would use 100%. On the other hand, if it is doing nothing over a long period, use strace or a similar utility to monitor your script at the OS level and found what it is waiting for.
Finally, you can also use a divide and conquer approach to find the slow loading module, insert sentences like the ones below between the use calls:
BEGIN { $| = 1; printf "%d: Foo\n", time }
use Foo;
BEGIN { printf "%d: Bar\n", time }
use Bar;
BEGIN { printf "%d: all modules loaded\n", time }
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.