in reply to Re: Require Load Times
in thread Require Load Times

That's kind of an interesting way of doing it. I wonder how CGI.pm's method of doing things compares to using autoloader? Typically, whenever I create a module, I prefer to just use h2xs -X modulename to set up my Makefile.pl and stub module. That stub module is already set up to use Autoloader. Would I be better off speed wise if I tried to implement my modules the same way that CGI.pm does?

In my particular case, most of my work is done with mod_perl, so I'm guessing that using Autoloader is probably better from a memory efficency perspective. Then again, I suppose CGI.pm is typically used in mod_perl as well. Can anybody shed some light on this subject?

Replies are listed 'Best First'.
Re: Re: Re: Require Load Times
by chromatic (Archbishop) on Dec 30, 2001 at 11:16 UTC
    The short answer is that it depends. The long answer is that shared memory is very very good in mod_perl situations. Some people go as far as to force CGI to compile all of the common subroutines when the server starts -- that way, they'll be available to any child that needs them in a shared memory page. If they had to be autoloaded occasionally during a request, each child would have its own copy in a fresh memory page.

    The mod_perl guide has lots of suggestions and equations.