[TYPO3-core] Announcing TYPO3 CMS 6.1.0 Alpha1

Christian Kuhn lolli at schwarzbu.ch
Tue Mar 19 19:29:01 CET 2013


On 03/19/2013 06:03 PM, Alexander Opitz wrote:
>> Class alias system eats some time, yes (mostly loading  of the cache
>> file).
>
> The cache file is loaded faster then the handling of the arrays. ;-)

BTW: The scenario you posted above with resetting the arrays in shutdown 
is especially important for unit tests (they unload / reload pretty 
often to force a clean state). We *might* extract the resetting to a 
different method (to be called by tests) and don't call it in shutdown, 
but that is more a hack - Without digging to deep into other possible 
impacts, I might be fine with that if we don't find a better  solution.

And I wonder why resetting such properties is so expensive in PHP.

Two questions pop up:

a) It might be possible that this overhead is solved in php 5.4. If it 
pretty much vanishes in 5.4, we might argue if a hack in this area is 
worth it (after some time a significant part of 6.2 lts instances will 
have 5.4. That is similar to 4.5 - php 5.2 is supported but not many 
instances run it nowadays). Users with maximum performance needs would 
use 5.4 now already since there is at least a 10% gain by default, 
usually more, together with a way better memory handling.

b) I don't know the php internals, but it might be possible that the 
resetting is so expensive because the whole class and the properties are 
static.
We could check if that is better if autoloader is an object instead:
Solution could be similar to the pseudo singleton thing done with the 
bootstrap class (store own instance in static property gettable by 
single static method, everything else is non static). Unregister could 
then just set itself as a new instance, so resetting the internal (then: 
non-static) array is obsolete.
Making the class loader non-static would be useful for other things as 
well and I've thought about that already multiple times, but didn't play 
with the code yet. Regarding backwards compatibility we won't have a big 
issues since it is handled by bootstrap only and thus internal code.


Regards
Christian


More information about the TYPO3-team-core mailing list