[TYPO3-core] Taming the Performance in 6.2

Mathias Schreiber mathias.schreiber at wmdb.de
Mon Nov 11 21:18:52 CET 2013


Quote: Jigal van Hemert wrote on Fri, 08 November 2013 11:30
----------------------------------------------------
> For another patch I had a look at the PHP docs to see what it does and 
> how it can influence speed.
> The "@" actually only temporarily sets the error reporting level to 
> zero. Error handlers are called as usual and nothing is changed to the 
> handling of the code.

> Checking if a file exists first is rather cheap (it's also cached) and 
> will prevent the whole error handling to take place (which won't have 
> any result except for burning CPU cycles).

currently we spend about 3% of a fully cached call on "file_exists".
I don't really consider this "cheap" but luckily that's why it's opinions :)

It doesn't matter, if it is cheap or not.
What matters is "can this be skipped?".

So the basic idea if we can skip the whole part of checking if a file exists so we try/catch it we might save A LOT of code lines (which are currently often prefixed with @ btw, but that's another story) plus we might have an increase in parsetime without ANY worries of side effects.
I mean... if the exception tells us the file does not exist and the require_once would fatal out anyways, what exactely are we discussing?
(Please consider the "if" in my proposal).

Regarding the "cached anyways" part.
I also explained during the Essen barcamp that it is lazy and just plain wrong to rely on caches while optimizing an application.
You can never be 100% sure these caches exist, they might be busy with other tasks on the machine.
After all it is about optimizing the app, not the caches :)

Apart from that I had a fruitful chat with Phillip and SteffenR at the camp as well, so expect quite a lot of no-brainer micro patches that will step by step increase performance.

My favourite so far:
if( substr( TYPO3_MOD_PATH , 0 strlen( 'sysext/' ) ) === 'sysext/' ) 
You can't argue on that one, can you? :)

Also I will try to organize some sort of agency sprint where we will just take a look at all (!) the code in order to find more things like these.

And please please please don't get me wrong.
I have full understanding that things like the one above occur - everyone has a brainfart once in awhile.
And I don't blame anyone for it.

So please stop taking all this personal, because it's not.
If someone goes "well, this doesn't make sense" it is very likely that he meant just this instead of "what idiot wrote this line?"

Relax, we all work on the same team :)


More information about the TYPO3-team-core mailing list