http://qs321.pair.com?node_id=724077

athanasia has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks,

I have used PAR::Packer's pp command in order to create a standalone perl executable for my application. (My OS is Windows Vista Home Premium, ActivePerl-5.8.8.822-MSWin32-x86-280952 and PAR::Packer 0.982).
The problem I am facing is the annoyingly long startup time when I double click on my exe. Depending on the PC's processing power, the time (of the first execution) ranges from 20 seconds to more than 40 seconds, giving the impression that the application is doing nothing!

The only related info I could find in the web was this discussion http://osdir.com/ml/lang.perl.par/2007-11/msg00019.html but it is somewhat complicated for me to follow.

The modules I am including in my script are quite a few
use threads; use threads::shared; use Time::HiRes; use Tk; use Cwd; use Tk::Icon; use Tk::TopLevel; use utf8; use Win32; use Win32::TieRegistry; use Win32::OLE('in'); use Win32::OLE qw(EVENTS); use Win32::FileOp qw(ShellExecute); use Net::UPnP::ControlPoint; use Net::Telnet; use LWP::Simple; use POSIX(":sys_wait_h"); use constant wbemFlagReturnImmediately => 0x10; use constant wbemFlagForwardOnly => 0x20; require "myhelpscript.pl";
and the command that I use for compilation is
pp -v -l C:\Perl\lib -l C:\Perl\site\lib -a C:\Perl\eg\myhelpscript.pl + --gui -i C:\Perl\eg\images\logo.ico -o myscript.exe myscript.pl
Can a more experienced monk point out some methods to decrease the unpack time or suggest any other solution around this problem?

Thanks in advance,
Athanasia

Replies are listed 'Best First'.
Re: Decrease startup time of perl executable in Windows
by hominid (Priest) on Nov 17, 2008 at 16:53 UTC
    I quit using PAR once I discovered Cava. It doesn't compress code like PAR does so the executables it creates start faster.
      If the .EXE that Cava generates is small enough, you may be able to convert it to a .COM file for an extra notch of speed, too.
      Indeed, I tried Cava and it is working perfectly. Not only has the startup time of the exe significantly decreased, but there are nice features that come along, such as console/gui option, use of icons, selection of run time privileges required (asInvoker, requireAdministrator etc.), easy edition of version/company/product name information...

      Thank you very much for suggesting this packager, I had never come across it in the past.

      Regards,
      Athanasia
Re: Decrease startup time of perl executable in Windows
by MidLifeXis (Monsignor) on Nov 17, 2008 at 17:05 UTC

    Is there a way to throw up a splash screen or something very early in the process? That might occupy the user until the real work starts.

    Of course, this is coming from someone who has not had to use a perl bundler before.

    --MidLifeXis