[TYPO3-core] RFC #9657: Instantiate time tracker as null object if not really required

Jeff Segars jsegars at alumni.rice.edu
Mon Aug 31 18:07:50 CEST 2009


Rupert Germann wrote:

> Bugtracker references:
> http://bugs.typo3.org/view.php?id=9657
> 
> Branches: Trunk
> 
> Problem:
> In the TYPO3 front-end an instance of t3lib_timeTrack is created in the 
> variable $TT. During the front-end rendering process the time required 
> to parse and execute several scripts and modules is stored using this 
> object. When there's no be_user logged in this information is never used 
> and so timetracking only eats up precious performance.
> 
> Solution:
> Use a null object with empty methods in general and only use the current 
> time tracker if a logged in be_user views pages in the front-end.


+1 on reading (and a quick, unofficial +0.5 on testing).

There's one bit of strangeness in t3lib_timeTrack because it defines the 
debug_typo3PrintError() method.  This method is actually called by 
tslib_fe->printError() when a database connection fails, page isn't 
found, etc to generate the well known TYPO3 error page. It's a static 
call to t3lib_timeTrack::debug_typo3PrintError() though so error 
messages continue to work even if the null class is used.

Thanks,
Jeff


More information about the TYPO3-team-core mailing list