[TYPO3-core] RFC #9355: Add an error and exception handler (backported from FLOW3)
Karsten Dambekalns
karsten at typo3.org
Thu Sep 17 12:58:16 CEST 2009
Hi.
I am going through the remarks given in this thread, here is a first
result on the instance vs. static issue:
On 16.09.2009, at 18:29, Oliver Hader wrote:
> I agree with Rupert that it's not required to load the error-/
> exception
> handler in any case. But if an error or exception occurs it should be
> handled somehow.
>
> Instead of calling inside an created object
> | set_error_handler(array($this, 'handleError'));
> we could use something like this from the outside
> | set_error_handler('t3lib_error_ErrorHandler::handleErrorCallback');
(The handling can be done fully static, no need to create an instance
at all).
I profiled (in FLOW3-land) the unchanged error handling vs. using a
static method and the result was hardly measurable. I suspected this
to be because we have to call setExceptionalErrors(), thus the error
handler class is loaded anyway. Thus I removed that call and the class
loader is no longer triggered. But the time required for
set_error_handler() goes up by about 9 times. No wonder, now the class
loader is triggered by that...
Attached are the XHProf results for unchanged, static (1) and static
without method call (2) variants.
The gain by avoiding that one instance creation is neglectable, so
I'll not change this handling in FLOW3.
Regards,
Karsten
--
Karsten Dambekalns
Gimme Five!
http://typo3.org/gimmefive
More information about the TYPO3-team-core
mailing list