[TYPO3-core] RFC #0011512: replace while(list()...) by foreach in the TYPO3 core part 1

Steffen Ritter info at rs-websystems.de
Sun Aug 2 15:52:59 CEST 2009


Christian Kuhn schrieb:
> Hi,
> 
> Rupert Germann wrote:
>> Type: performance improvement
>>
>> Bugtracker references:
>> http://bugs.typo3.org/view.php?id=11512
>>
>> Branches: Trunk
>>
>> Problem:
>> foreach() has proven[1] that it is way faster than while(list()=each()) and
>> in current PHP versions foreach() even needs less memory than while().
>>
>> Solution:
>> replace while(list()=each()) with the appropriate foreach() statements in
>> frontend classes
> 
> +1 on reading, testing and profiling.
> 
> As it's impossible to really test every change, I just read the diff
> with attention and verified there is no change in behavior on two of my
> sites.
> 
> Attached patch takes Steffen's nitpicking for Line 88, 394 and 456 into
> account, while 799 is unchanged (key is not used, no reason to add it).
> 
> My quite simple test-sites showed (non-cached) performance advantages
> around 1 percent. This is near to my usual testing variance, however non
> of my "post-patch" runs where slower than without patch.
> As Rupert already mentioned, the patch will probably have more impact on
> complex pages with eg. deep menu structures.
> 
> 
> Regards
> Christian
> 
+1 on testing

I really like all the small thins which currently are done for 
performance... Great :)


More information about the TYPO3-team-core mailing list