Re: extends PEAR
| From: | Greg Beaver | Date: | Sat, 16 Oct 2004 15:22:13 +0000 |
| Subject: | Re: extends PEAR | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-33896@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
Greg Beaver wrote:Actually, the register_shutdown_function() call is not in the PEAR constructor, but instead in the global code at the end of PEAR.php. Perhaps this could be changed to be called in the constructor instead, using a static to determine whether it has been called? It would be a significant boost in the functionality of objects that don't have a destructor. The constructor could check for the presence of a destructor with method_exists($this, '_' . get_class($this)) as it does in the actual destructor. As soon as CVS is back up, I would be able to commit this change. GregNot necessarily. The act of registering the shutdown function adds a significant overhead in my profiling tests. If you lazy-register the shutdown function (only when a transaction is initiated), then you could save a bundle of time for the more common cases.Thats an interesting point. However I could also take advantage of this by only calling the PEAR constructor during the first transaction. So this is not a point relevant to the original question though.