[TYPO3-core] Announcing TYPO3 CMS 6.1.0 Alpha1

JoH asenau info at cybercraft.de
Tue Mar 19 16:43:19 CET 2013

Am 19.03.2013 16:16, schrieb Alexander Opitz:
> Heyho,
> so I found one of the big mess in time and it seems to be the Class
> TYPO3\CMS\Core\Core\ClassLoader
> In ClassLoader::unregisterAutoloader we have three lines
>      static::$classNameToFileMapping = array();
>      static::$aliasToClassNameMapping = array();
>      static::$classNameToAliasMapping = array();
> All three vars are very large and so PHP needs much time to clean up
> memory. As we are on unloading, do we need to reset them to empty
> arrays? This takes 1%-2% of time for a cached request.
> In ClassLoader::loadClassLoaderCache we have the lines
>      static::$classNameToAliasMapping =
> array_flip($aliasToClassNameMapping);
>      self::setAliasesForEarlyInstances();
> The array_flip function call takes around 1% of time
> $aliasToClassNameMapping is to large.
> The setAliasesForEarlyInstances function does a array_intersect on very
> large arrays and takes around 5% of time.
> So I get 7% - 8% speed improvements only by removing this lines.
> I know, thats not the best way, but a point to start, maybe we need to
> reduce the amount of old class names to get the arrays smaller (5000+
> entries).

BTW: The results are similar to my first test, but the major problem is 
not about array functions - you could i.e. replace array_intersect with 
array_inersect_key on flipped arrays to get a better result - actually 
most of the time is eaten by the string functions used to convert old 
class names to new class names and back.

And of course another problem is that we got tons of small classes now 
due to the code cleanup process. So the point might be to find a better 
balance between overall number of classes and overall number of methods 
within a single class.

But could we please discuss this in a separate thread about exactly that 
specific topic: Performance improvements? Otherwise it might not be 
recognized by other people who just look at the topic.



Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com

More information about the TYPO3-team-core mailing list