[TYPO3-core] RFC: #13670: Performance optimization: change while(list() to foreach()

Susanne Moog info at susannemoog.de
Thu May 20 07:22:42 CEST 2010


Hi,

On 19.05.2010 23:06, Ernesto Baschny [cron IT] wrote:
> The test you are refering to is a "modify loop". If you scan a bit down
> on that page there is also the "read loop", which only reads the values
> and proves that "foreach" is about 6x faster.

whoops, I was blind I guess, I really did not see the second loop test
*headshake*. That clears things up, thanks.

> I haven't checked if all our accesses are read-only, but I am pretty
> confident that most of them are, which makes the change is justified.
> For the ones that aren't I think it makes sense to keep it "foreach" to
> keep it consistent readable.
> 
> We could agree to keep while/each on modify-loops which are heavily
> used. To spot those we need more benchmarking.

I'm not really a pro in benchmarking but wanted to dig into it a bit in
the next weeks, so I can use this as a test case :-)

Susanne


More information about the TYPO3-team-core mailing list