in reply to why the exe runs so slow compiled by pp in the first time

Well, the executable needs to unpack perl and all the of the modules, and that takes time. I guess that these files are stored somewhere, so that subsequent runs can reuse them, which speeds up the second run.
  • Comment on Re: why the exe runs so slow compiled by pp in the first time

Replies are listed 'Best First'.
Re^2: why the exe runs so slow compiled by pp in the first time
by CountZero (Bishop) on Aug 23, 2011 at 18:09 UTC
    I guess that these files are stored somewhere
    Yes, the unpacked files are stored in your temporary directory (and therefore likely to be reaped upon closing/restarting your computer).

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re^2: why the exe runs so slow compiled by pp in the first time
by Anonymous Monk on Aug 23, 2011 at 15:28 UTC

    the executable will unpack to perl?

    it's disappointing, I thought pp has turn it into a totally binary code which is no different to a common C program

      no, pp just 'packs perl' into a self extracting executable. definitely has it's uses, but it does not turn your code into binary.

      run procmon or something similar to find the path that your script.exe is running from and you can see all of your code and any included modules

        I used the procmon to find out what happened in the first run. it turns out to be what you've said, the executable really unpacked many .pm modules into the temporary directories.

        thanks for help

      it's disappointing
      Why is that disappointing? It is still Perl.

      And as you remarked, its main use is to deploy applications on machines that do not have Perl installed.

      The docs of pp clearly state "Source files are compressed verbatim without compilation".

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

        thanks for reply. I will read the doc of pp :)