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

Hello,

I like to generate "exe"-files from perl scripts with "pp".

For Example:

pp -o hello.exe hello.pl

The first time I execute "hello.exe" it takes some seconds before it is really started. I know the reason. The first time the exe-file is unpacked to a temporary directory.

The second time I start "hello.exe" is quick because just the stuff in the temporary directory is executed.

Even when I logoff and then logon again and then I start the "hello.exe" it is started fast.

But when I do a restart of the computer and then execute "hello.exe" then it takes again some seconds. It seems that it is unpacked again to a temporary directory.

This is my problem. I want that after a restart the "exe" is started fast. There shall not be an unpacking. The goal is that only the first time the exe-file is unpacked to a temporary directory. If the computer is restarted it shall take the stuff from the temporary directory and not unpacking it again.

Thank you for your help.

Greetings,

Dirk

Replies are listed 'Best First'.
Re: faster start of "exe" generated by pp
by Eliya (Vicar) on Apr 06, 2011 at 15:41 UTC

    In case the problem is that the system's temp space is being cleaned up on reboot, you might want to tell PAR to unpack into a different directory by setting PAR_GLOBAL_TEMP.  See also Notes.

      Thank you all for your answerws.

      PAR_GLOBAL_TEMP really helps to control where the exe-file is unpacked. But it does NOT solve the problem.

      Although the folder with the unpacked files is still available after a restart it takes some seconds until the exe-file is executed.

        But it does NOT solve the problem.

        Then maybe the issue you really have is not the unpacking, but rather that first-time starts of the exe do not have the advantage of files and shared libraries already having been cached/buffered in memory by the OS, as subsequent starts would have.

        There's not a lot you can do in this case...

Re: faster start of "exe" generated by pp
by MidLifeXis (Monsignor) on Apr 06, 2011 at 15:21 UTC

    Not having used pp, this is just a guess. Does your system clean up the temp space on reboot? I know that this can be SOP in some shops.

    --MidLifeXis

Re: faster start of "exe" generated by pp
by Anonymous Monk on Apr 06, 2011 at 14:58 UTC
    I don't know the answer (it probably isn't trivial, but it is definitely doable), but I do know that Cava packager takes the approach of install/unpack once
Re: faster start of "exe" generated by pp
by lamprecht (Friar) on Apr 07, 2011 at 15:55 UTC
    Can you try
    pp -o hello.exe --clean hello.pl

    and run it without PAR_GLOBAL_TEMP being set?

    Cheers, CHristoph

      Wow, thank you. This really helped.

      The first time start of the exe is much faster as before. Nearly as fast as when I start it the second time.