[Typo3-dev] TYPO3 3.7.0 memory usage ?

Michael Johnston mjohnston at planetactive.com
Fri Sep 17 11:39:59 CEST 2004


There is definitely massive amounts of copying going on.

I haven't looked at the code since 3.6 so maybe this is already done, 
but on our first typo3 site (about 3000 pages) we were quite surprised 
to discover how big a difference it made to convert all double quotes 
to single quotes in our own code where no interpolation (or newlines 
etc) is needed. Defines also seem expensive, at least in processor 
usage, not sure why.

On this one site (which had quite a lot of custom code -- 30 or so 
plugins, used 100% custom content elements, and had a fair amount of 
pulling dynamic content from external sources) we were able to get 
almost all of our own code out of the top 20 in the profiler with less 
than a days work optimizing. That was quite a pleasant surprise, 
actually. Other things we did were the usual: pre-setting loop 
boundaries, passing arrays & objects by reference, etc. Most of these 
optimizations were done with sed & a little manual cleanup. We'd 
programmed passing by reference from the beginning though, based on our 
experience with other php sites.

So it might not be as hairy a job as it seems, though not having unit 
tests makes it scary.

On 16-Sep-04, at 4:35 PM, Martin T. Kutschker wrote:

> Michael Stucki wrote:
>> Hi Sylvain,
>>> Can be 3.7.0 more memory consuming than previous version ?
>>>
>>> My server report a:
>>>
>>> Fatal error: Allowed memory size of 25165824 bytes exhausted (tried 
>>> to
>>> allocate 40 bytes) in
>>> /home/www/typo3/typo3_src-3.7.0-dev/t3lib/class.t3lib_div.php
>>> on line 1822
>> Yes, you're right. Kasper is aware of this and tries to find a 
>> solution for
>> that problem:
>
> I suggest to stop doing repeated string concatenations and passing 
> around big junks of output in $content, etc.
>
> Another big win would IHMO to use array references rather than copies.
>
> I've seen code in the EM where a part of an assoc is passed (as value) 
> to an subroutine just to replace the original value within the array. 
> IMHO waste of CPU cycles on an unnecessary copy plus waste of memory.
>
> I fear the whole TCA stiff is written like the TCA. It'd be a PITA to 
> change all relevant code - without breaking something where a copy is 
> actually required.
>
>> But hold on, I'm sure there's a solution for this...
>
> I wish I could hope like you. New features need more power, and now 
> that Typo3 uses XML internally...
>
> Masi
> _______________________________________________
> Typo3-dev mailing list
> Typo3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev






More information about the TYPO3-dev mailing list