|XP is just a number|
Minimizing PAR performance hitby gaal (Parson)
|on Jan 07, 2007 at 10:16 UTC||Need Help??|
gaal has asked for the
wisdom of the Perl Monks concerning the following question:
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?