Re: [PHP] Performance: While or For loop

2007-03-27 Thread Tijnema !
On 3/27/07, Travis Doherty <[EMAIL PROTECTED]> wrote: Jake Gardner wrote: > He said if you run the /script/ itself 1000 times, not a loop with 1000 > iterations. This is quite possible; I am fairly certain there are > websites > out there that get accessed well over 1000 times a minute, yes? > >

Re: [PHP] Performance: While or For loop

2007-03-26 Thread Travis Doherty
Jake Gardner wrote: > He said if you run the /script/ itself 1000 times, not a loop with 1000 > iterations. This is quite possible; I am fairly certain there are > websites > out there that get accessed well over 1000 times a minute, yes? > > So every minute, that website is saving a total of 2.6

Re: [PHP] Performance: While or For loop

2007-03-26 Thread Jake Gardner
He said if you run the /script/ itself 1000 times, not a loop with 1000 iterations. This is quite possible; I am fairly certain there are websites out there that get accessed well over 1000 times a minute, yes? So every minute, that website is saving a total of 2.6 seconds to do... whatever it is

Re: [PHP] Performance: While or For loop

2007-03-26 Thread Richard Lynch
On Sat, March 24, 2007 4:52 am, Tijnema ! wrote: >> That means that at 1000 iterations, you are "saving" how much time? >> >> .00026 seconds? >> .4 seconds? >> >> Puhleaze. > > Well, if you execute this script 1000 times, you would get a > difference of 2.6 seconds? > But if every microseconds

Re: [PHP] Performance: While or For loop

2007-03-24 Thread Robert Cummings
On Sat, 2007-03-24 at 14:38 -0400, tedd wrote: > At 2:24 PM -0400 3/24/07, Robert Cummings wrote: > >On Sat, 2007-03-24 at 10:21 -0400, tedd wrote: > >> At 7:47 PM -0500 3/23/07, Richard Lynch wrote: > >> >Folks: > >> > > >> >How often do you use a loop of any kind in PHP with enough iterations

Re: [PHP] Performance: While or For loop

2007-03-24 Thread tedd
At 2:24 PM -0400 3/24/07, Robert Cummings wrote: On Sat, 2007-03-24 at 10:21 -0400, tedd wrote: At 7:47 PM -0500 3/23/07, Richard Lynch wrote: >Folks: > >How often do you use a loop of any kind in PHP with enough iterations >that this is even significant? > >Write the code that makes sens

Re: [PHP] Performance: While or For loop

2007-03-24 Thread Robert Cummings
On Sat, 2007-03-24 at 10:21 -0400, tedd wrote: > At 7:47 PM -0500 3/23/07, Richard Lynch wrote: > >Folks: > > > >How often do you use a loop of any kind in PHP with enough iterations > >that this is even significant? > > > >Write the code that makes sense. > > > >Optimize the biggest bottleneck unt

Re: [PHP] Performance: While or For loop

2007-03-24 Thread tedd
At 7:47 PM -0500 3/23/07, Richard Lynch wrote: Folks: How often do you use a loop of any kind in PHP with enough iterations that this is even significant? Write the code that makes sense. Optimize the biggest bottleneck until performance is acceptable. Absolutely -- the time we take discussi

Re: [PHP] Performance: While or For loop

2007-03-24 Thread Sancar Saran
Hi, I'm using so much FOR loops in my code, after seeing discussion I try to test. My findigs it was giving %2 to %10 percent performance boost. So ? My recent template addon to this code cost me around %5 to %10 percent of total page process.. I think It was nice trade off. Thank you guys.

Re: [PHP] Performance: While or For loop

2007-03-24 Thread Tijnema !
On 3/24/07, Richard Lynch <[EMAIL PROTECTED]> wrote: On Fri, March 23, 2007 7:54 pm, Tijnema ! wrote: > On 3/24/07, Richard Lynch <[EMAIL PROTECTED]> wrote: >> Folks: >> >> How often do you use a loop of any kind in PHP with enough >> iterations >> that this is even significant? >> >> Write the c

Re: [PHP] Performance: While or For loop

2007-03-23 Thread Richard Lynch
On Fri, March 23, 2007 7:54 pm, Tijnema ! wrote: > On 3/24/07, Richard Lynch <[EMAIL PROTECTED]> wrote: >> Folks: >> >> How often do you use a loop of any kind in PHP with enough >> iterations >> that this is even significant? >> >> Write the code that makes sense. >> >> Optimize the biggest bottle

Re: [PHP] Performance: While or For loop

2007-03-23 Thread Robert Cummings
On Sat, 2007-03-24 at 01:54 +0100, Tijnema ! wrote: > On 3/24/07, Richard Lynch <[EMAIL PROTECTED]> wrote: > > On Thu, March 22, 2007 5:14 pm, Tijnema ! wrote: > > > On 3/22/07, Jon Anderson <[EMAIL PROTECTED]> wrote: > > >> Your test isn't exactly fair. The for loop has no statements in it, > > >>

Re: [PHP] Performance: While or For loop

2007-03-23 Thread Tijnema !
On 3/24/07, Richard Lynch <[EMAIL PROTECTED]> wrote: On Thu, March 22, 2007 5:14 pm, Tijnema ! wrote: > On 3/22/07, Jon Anderson <[EMAIL PROTECTED]> wrote: >> Your test isn't exactly fair. The for loop has no statements in it, >> and >> the while loop has one. Your tests show while as approx 7% f

Re: [PHP] Performance: While or For loop

2007-03-23 Thread Richard Lynch
On Thu, March 22, 2007 5:14 pm, Tijnema ! wrote: > On 3/22/07, Jon Anderson <[EMAIL PROTECTED]> wrote: >> Your test isn't exactly fair. The for loop has no statements in it, >> and >> the while loop has one. Your tests show while as approx 7% faster, >> while >> a modified test shows an approximate

Re: [PHP] Performance: While or For loop

2007-03-23 Thread Tijnema !
On 3/23/07, Mario Guenterberg <[EMAIL PROTECTED]> wrote: On Fri, Mar 23, 2007 at 12:24:45AM -0500, Travis Doherty wrote: > After multiple runs I see that the for pre-increment loop is fastest. > Note that the while loop with a post-increment runs once more than with > a pre-increment. > > Everyti

Re: [PHP] Performance: While or For loop

2007-03-22 Thread Mario Guenterberg
On Fri, Mar 23, 2007 at 12:24:45AM -0500, Travis Doherty wrote: > After multiple runs I see that the for pre-increment loop is fastest. > Note that the while loop with a post-increment runs once more than with > a pre-increment. > > Everytime I run, the results are *very* different, though still

Re: [PHP] Performance: While or For loop

2007-03-22 Thread Travis Doherty
Tijnema ! wrote: > On 3/22/07, Jon Anderson <[EMAIL PROTECTED]> wrote: > >> Your test isn't exactly fair. The for loop has no statements in it, and >> the while loop has one. Your tests show while as approx 7% faster, while >> a modified test shows an approximate 30% speed improvement: >> >> Do th

Re: [PHP] Performance: While or For loop

2007-03-22 Thread Tijnema !
On 3/22/07, Jon Anderson <[EMAIL PROTECTED]> wrote: Your test isn't exactly fair. The for loop has no statements in it, and the while loop has one. Your tests show while as approx 7% faster, while a modified test shows an approximate 30% speed improvement: Do this: for ($i=0;$i<1000;$i++) {

Re: [PHP] Performance: While or For loop

2007-03-22 Thread Tijnema !
On 3/22/07, Jake McHenry <[EMAIL PROTECTED]> wrote: does this help? http://www.php.lt/benchmark/phpbench.php Jake Well, there wasn't a test between For and While, so i did it myself, and i'm quite confused about the result. I let PHP count from 0 to 1 on my 1ghz AMD Athlon. While did

RE: [PHP] Performance: While or For loop

2007-03-22 Thread Jake McHenry
does this help? http://www.php.lt/benchmark/phpbench.php Jake > -Original Message- > From: Tijnema ! [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 22, 2007 4:38 PM > To: PHP > Subject: [PHP] Performance: While or For loop > > Hi, > > Does somebody has benchmarks of what is fast