I agree, these artificial benchmarks are useless.  The "modify loop"
benchmark showing foreach being 80x slower than while surprised me, so
I gave it a quick test here.  I found quite the opposite, with

foreach($data as $key => $val) $data[$key] .= 'a';

being 5x faster than the while loop.  But then I tested an array with
100K elements, so was comparing 0.09 seconds to 0.5 seconds.  The link
provided tests an array with 100 elements - and so is comparing
_microseconds_.  Neither is "correct", they both just test different
artificial, and trivial, cases.

So basically, none of this stuff matters - until it matters in your
app.  When your big collation function that loops over millions of
elements is running slowly, then it might be worth looking into these
kind of optimisations.



On Jun 4, 1:21 am, "Marcin Domanski" <[EMAIL PROTECTED]> wrote:
> it would be good to test it in real life app.
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to