Re: minute performance gain

From: Date: Mon, 18 Oct 2004 15:40:58 +0000
Subject: Re: minute performance gain
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-33938@lists.php.net to get a copy of this message
Jon Parise wrote:
On Sun, Oct 17, 2004 at 02:05:15PM -0400, Greg Beaver wrote:
I took the register_shutdown_function and moved it to the PEAR class constructor, inside the code that checks for destructors, and found a miniscule performance gain. Zend IDE's profiler reported that the time it takes to run 'PEAR.php'; decreased from .35 ms to .28 ms. By far the most significant performance hit comes from the require_once call, which leads me to believe that even using PEAR_Exception would do nothing to improve performance unless you put everything in 1 big-ass file. :)
To be fair, you only see this performance gain when no destructor is exists (and register_shutdown_function() is not called), yes?
Yup .. That brings me to another issue. Since the PEAR class defines a destructor it kinda sucks to extend from PEAR needlessly. Obviously if you dont call the PEAR class constructor you get around this issue. Since the constructor currently only handles destructor registering as well as default error class setting this is less of an issue, since you can easily live without setting the default error class this way (is there a separate set method?). However the PEAR default destructor seems a bit useless for generic purposes. regards, Lukas

« previous php.pear.dev (#33938) next »