[TYPO3-core] RFC #16951: [Performance] Speed up makeInstance() by caching getClassName() results

Jeff Segars jsegars at alumni.rice.edu
Mon Jan 10 21:20:27 CET 2011


On 1/8/11 6:54 PM, Christian Kuhn wrote:
> This is an SVN patch request.
>
> Type: Performance improvement
>
> Branches: trunk
>
> BT: http://bugs.typo3.org/view.php?id=16951
>
> Problem:
> Every makeInstance() call determines the final class name by checking in
> getClassName() with class_exists() for 'ux_' classes.
>
> Solution:
> Add a very simple first level cache around the getClassName() call to
> look up already determined final class names in a local array for
> consecutive calls with the same class.
>
> Notes:
> The autoloader (which eats up most time of the class_exists() call) is
> pretty expensive but has some local caching as well. So, this patch is
> not as effective as it seems at first glance and just speeds up 'a bit'.
> On a pretty native introduction package I was able to reproduce a gain
> for a full cached page between 0,5 and 1,5%, which is actually near to
> experimental standard deviation. Still, this patch can not make things
> slower.
>
> Regards
> Christian

+1 on reading and testing. Just change "ginal" to "final in the comments 
when you commit ;)


More information about the TYPO3-team-core mailing list