Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Performance penalties of in-Perl docn vs compiled CGIs.

by LanX (Saint)
on Feb 02, 2021 at 14:57 UTC ( [id://11127818] : note . print w/replies, xml ) Need Help??


in reply to Re: Performance penalties of in-Perl docn vs compiled CGIs.
in thread Performance penalties of in-Perl docn vs compiled CGIs.

> subject which more often than not is futile.

The benefits are too small or non-existant. This whole .plc mechanism was invented back in the days when RAM was sparse and processors slow,hence the compilation phase was a considerable factor.

Turning a Perl process into a persistent demon solves most, if not all use cases nowadays. That's because IO is now most limiting factor, and neither compile-phase nor IO needs to be redone.

I have trouble imagining a use case where pre-compilation would pay off, because this would still be hampered by IO.

The only aspect where pre-compilation tends to be used is obfuscation to protect the code. But that's also mostly wishful thinking.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

) RAM-Disk? Seriously?

Replies are listed 'Best First'.
Re^3: Performance penalties of in-Perl docn vs compiled CGIs.
by bliako (Monsignor) on Feb 02, 2021 at 15:56 UTC
    because IO is now most limiting factor

    Right. Given also that for 200 lines of Perl (+ 3rd party modules) I got back a 25MB C program which I don't dare to imagine what executable size will yield and when.

      > I got back a 25MB C program

      That's because a compiled run-time will have to carry most if not all of Perl.exe with it.

      > which I don't dare to imagine what executable size will yield and when.

      I think there is an upper limit/plateau once all features are bundled.

      Now ... lets suppose a use case where we needed to restart hundreds of Perl scripts as fast as possible:

      A "master-demon" holding the sources, compiling,forking and killing other demons is most probably more efficient.

      For instance:

      A webserver in combination with FCGI can be seen as such a "master-demon".

      And mod-perl is the variant where different scripts are sharing the same run-time (with the complication to avoid conflicts to minimize the footprint)

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery