[sf-perl] making perl compile phase faster
james at ActionMessage.com
Fri Apr 29 15:33:23 PDT 2011
SpeedyCGI aka PersistentPerl works for some people (including me)
for pre-compiling console apps, as well as an alternative to
mod_perl Registry mode.
Try it out. (I don't think it is maintained much these days.)
On Fri, 29 Apr 2011 12:30:41 -0700, Michael Friedman wrote
> I'm having a lucky day, so why not test it...
> At my site, we run a lot of command-line perl scripts. Unfortunately,
> we also have 2794 perl modules. Some of our scripts load up
> thousands of lines of perl code before they can do anything, even
> display a usage statement. Generally, from the time you hit <return>
> it's at least 5 seconds before anything happens, often longer,
> because perl has to load in all the required modules.
> At one point, I looked into using SelfLoader and making every method
> into an autoloaded method, but that failed on some of our important
> modules because they were not coded to be as... we'll go with
> "clean"... as I would like. And since we have thousands of modules,
> any solution has to be automated across nearly everything to work.
> I can't get in the way of the rest of the development team's work,
> even for a noticeable performance gain.
> So, let me ask y'all:
> 1. Is there anything approaching a "perl compiler" these days?
> (Something that does the compile stage early and lets you then just
> run the binary later.)
> 2. Is there a better option than SelfLoader now, for only compiling
> the methods that you are actually using instead of all of them? (As
> you would guess, a 1,000+ line perl module has a lot of things in it
> that you don't need for any one script.)
> 3. Are there ways of marking up methods so they don't get parsed and
> compiled until they're needed?
> Thanks for any advice, tips, or tricks!
> -- Mike
> PS - We aren't using Moose or anything like that. All the modules
> are hash-based, generic Perl objects and function libraries. If
> there's a class structure framework or something that could take
> care of this partial compilation for me, that'd work too.
> Mike Friedman | HighWire Press, Stanford Univ | friedman at highwire.stanford.edu
More information about the SanFrancisco-pm