I'm seeking practical ways of reducing the runtime hit (in CPU and especially RAM) of using PAR.

I have a program with dependencies on various modules such as Net::SSH::Perl, Net::SNMP, Net::SSLeay, and XML::Twig. When I run it without PAR in a certain refrence mode, it takes about 10 seconds to complete (some of the time is spent waiting for the network end) and 15MB resident RAM at peak. Let's say I can live with that.

Under full PAR (that is, pp and a self-contained executable), the load time (once the cache is warm) is increased by about one second, and the memory consumption jumps to 22MB. The program on disk is about 7.7MB.

Since I can assume perl itself is installed on my deployment machine, I tried using pp -P, which produces a script (not bundling perl). Now my program on disk is about 5.6MB, the startup hit is only ~0.5 sec, and peak RAM is about 21MB, all in all not a great improvement.

Supposing I can assume perl and PAR, and maybe even strategical additional Perl modules but not all are available on my deployment machine, can you suggest a better bundling method that can decrease the hit? The half-second is okay, but the 6MB is probably not.

The system is CentOS 4.4, running Linux 2.6.9.

Update: --dependent didn't seem to help at all? Is it implied by -P?


In reply to Minimizing PAR performance hit by gaal

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.