[TYPO3-project-4-3] autoloader using SPL

Dmitry Dulepov [typo3] dmitry at typo3.org
Mon Aug 4 16:52:53 CEST 2008


Hi!

Ingo Renner wrote:
>>> All in all I think that having autoloading in 4.3 is _a must_. When 
>>> doing some profiling using xdebug + kcachegrind I found that one 
>>> aspect that slows TYPO3 down a lot are the many many includes we do 
>>> as each include means a hard disk read access - and we all know that 
>>> HDDs are slow.
>>
>> Firsts, does require_once is the problem too?
> 
> ??

You say that many includes is a problem. We mainly use require_once, so files should be included more than once. I do not understand where the problem comes from. Or do you mean that files are included and not used?

> You'll always need or some kind of slow but large memory storage.

Not always ;) At the moment all TYPO3 scripts fit into eAccelerators cache, less than 256MB.

>> On the other hand many TYPO3 files always include files but use them 
>> only in some cases. 
> 
> That's exactly the problem.

Shouldn't we start reviewing those?

> This is not a blinf action as I described how I think it 
> should/would/would work. In the worst case it's just as slow/fast as the 
>  current way of including all files. In all other cases it's most likely 
> going to be faster.

require_once(PATH_t3lib . 'class.t3lib_db.php');

vs

$path = Registry::search('t3lib_db');
require_once($path);

This is my concern. But overall - yes, it may be faster if files are included only when it is truly necessary. I think that point is valid and we should try it!

-- 
Dmitry Dulepov
TYPO3 Core team
My TYPO3 book: http://www.packtpub.com/typo3-extension-development/book
In the blog: http://typo3bloke.net/post-details/typo3_code_formatting_in_eclipse/


More information about the TYPO3-project-4-3 mailing list