PHP optimizations (was: [Typo3-dev] decrease memory usage)

"Kasper Skårhøj" kasper at typo3.com
Tue Sep 9 12:12:12 CEST 2003


># Use the array and string functions where possible. They are faster than
>writing equivalent code in PHP.
>
>Note: this is of course true for the upcoming encoding functions.
>iconv/recode and mbstring should IMHO be favoured for self written PHP
>functions. There's no need to reinvent the wheel anyway.

I rely first and foremost on my own functions for one single reason: I know it will work on all platforms regardless of PHP extensions etc.
My idea is that we can change the class internally to use native functions if they are available (recode, iconv, whatever). 
If someone wants to work on this they are welcome. Probably I will spend my time on something else as long as my own functions work. But I acknowledge that they can be tuned, no doubt. In particular for chinese... (which loads and parses a conversion table of 400 kb each time... :-)

Apart from that my conversion functions seems fast enough for all the tested single-byte charsets (iso-8859-* + windows-*)



>And of course - most important!
>
># Tune your database and index the fields that are commonly used in your
>SQL WHERE criteria.

Someone, help me.


>Not mentioned here, but in such a large application like Typo3 it could
>make a difference: use single quotes instead of double quotes if you don't
>need variable interpolation.

Which is in fact in the coding guidelines already.


- kasper
-------------------- o ---------------------
>>>    In God I trust - others pay cash!     <<<
Check www.typo3.com







More information about the TYPO3-dev mailing list