in reply to An AUTOLOAD performance puzzler
My suggestion for this case is to avoid laziness. Instead of AUTOLOAD (or in addition to it) have the abstract base class supply a function that autogenerates the simple getters and have that be called from each subclass. (Or you could do this in addition to having the AUTOLOAD.) The method cache still gets lost a ton of times, but all of the flushing happens before you start calling lots of methods, so it doesn't hurt so badly.
|
|---|