Perl startup is "slow" by some measures.

It starts the engine, does a lot of initializing, has to load various modules from filesystem and if they are lots of pure Perl need to compile them, and probably need to repeat all this to import more dependencies.

So many things to consider, such that your benchmarks should be more detailed, probably using the NYT profiler.

I don't think anything below 0.3 secs is really worth worrying, but if you really need to run a program many times you should consider talking to a server with everything pre-initialized. That's the trick behind fast-cgi etc... You'll trade space for time like that.

But if that's not an option because you have too many different programs which need boosting, you could consider bundling all dependency into one big package with par-packer and precompiling them into a .plc with bytecode and store them in a ram-disk.

Disclaimer: Never tried that myself, cause as I said, Perl startup is usually fast enough for me. (perltidy probably being the only exception)

Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery


In reply to Re: slow startup for some common modules? (autodie, Pod::Usage, Getopt::Long)) by LanX
in thread slow startup for some common modules? (autodie, Pod::Usage, Getopt::Long)) by almr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.