I'm new to Joomla, and thus I'm trying to learn as much as possible from the source and the documentation that joomla and its community provides.

So far I'm happy with everything.. But I fell over a little optimization in the JLoader::load method and php5 autoloader

1) The old code invoked strtolower() on the classname twice (line 132 + 139)
2) The old code invoked class_exists with no 2nd param - thus php will try to find the class by scanning __autoload - the patch changes this so if the ::load call is from the autoloader itself, php should do no effort to find the file on it's own.

Both is micro optimizations, but they are for free without any effects to the system.

2 in paticular has the potential of saving both some IO and CPU time

I have attached the file in git unified diff format.

Can also be found here:
and here (normal diff output format)
Opened On:
17 Sep 2009, 15:04 by Christian Winther
Closed On:
4 Feb 2010, 2:55

Filed Under

  • All


Posted on 4 Feb 2010, 2:55 by Hannes Papenberg
Implemented in trunk