Thanks for this information... it is confirming what I originally thought, so I don't need to change my code (yet). But I wanted to post it back to the list to everyone else can benefit from it.
I personally tend to avoid AUTOLOAD, only because it is a piece of perl "magic" that can be super-confusing to developers coming to perl (and mod_perl) from other languages (um, Java) and I think there's a voodoo-level involved that's a bit high for my tastes. In the one place I use it, I don't generate anything, just trap calls to methods with AUTOLOAD and perform a lookup based on the arguments. If it really is that slow, maybe I'll even rewrite that to use something other than AUTOLOAD.
Cheers!
Kyle Dawkins
Central Park Software
On Tuesday, Dec 17, 2002, at 13:13 US/Eastern, Perrin Harkins wrote:
kyle dawkins wrote:Sorry to mail you directly... can you just give me two cents on your comment below about AUTOLOAD, mod_perl and memory sharing? I use AUTOLOAD in one module to perform accessors and I wonder if there's a better way to save memory.AUTOLOAD is kind of slow, so most people put something in there to define their accessors as subs by manipulating the symbol table. It's easy, and Damian's book has an example.
In mod_perl, you want any methods that you expect to be called to be defined in the parent process so they will be shared. I do this by building all of the accessors in a BEGIN block in my module which is called when I use it in startup.pl.
- Perrin