in reply to Re: Re: modules slowing webpage
in thread modules slowing webpage

mod_perl is only a better answer if its an option. Yes I know move to a different host if your doesn't have mod_perl, but then thats not realy an answer is it? Perhaps it could be considered one. The real question is why do we have to wait for perl to compile a module, i mean its going to be compiled the same everytime isn't it? At least on the same system, so why not save it right after that compiling process? Its possible, maybe even likely, that this is impossible or just very difficult, or just impractical. Could someone with more intimate knowledge of perl, than myself, explain why this would be bad or impossible?

Thanks.


___________
Eric Hodges

Replies are listed 'Best First'.
Re: Re: Re: Re: modules slowing webpage
by simonm (Vicar) on May 10, 2004 at 22:11 UTC
    The real question is why do we have to wait for perl to compile a module, i mean its going to be compiled the same everytime isn't it?

    When a module is loaded, it isn't just "compiled" -- it undergoes a multi-part process including parsing and execution that produce run-time changes in the state of the Perl interpreter. A module can load other modules, install symbols in other packages, and perform other "compile-time" actions that are difficult to freeze in a static form.

    As a result, most of the dump/compile techniques are intended to work with entire programs, not individual modules. (See the perlcompile manpage and the B::CC module.)

    I think you might be able to process individual modules using B::Bytecode and ByteLoader. This might improve performance by a bit, but I believe the overhead and limitations will prove daunting.

Re: Re: Re: Re: modules slowing webpage
by Anonymous Monk on May 11, 2004 at 10:53 UTC
    mod_perl is only a better answer if its an option. Yes I know move to a different host if your doesn't have mod_perl, but then thats not realy an answer is it? ...
    mod_perl is always an option. Bytecode is never an option. perldoc B::Bytecode ... BUGS Output is still huge and there are still occasional crashes during either compilation or ByteLoading. Current status: experimental..