Re: Performance: While or For loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 websites do in their free time.

In reality, scripts rarely get executed once and then are deleted; they are
used repetitively, and the more a script is used, the more significant the
gain. Claiming to look practically on a small gain /within one execution of
a script/ is impractical in itself.

On 3/26/07, Richard Lynch <ceo@xxxxxxxxx> wrote:

On Sat, March 24, 2007 4:52 am, Tijnema ! wrote:

>> That means that at 1000 iterations, you are "saving" how much time?
>>
>> .00026 seconds?
>> .00004 seconds?
>>
>> Puhleaze.
>
> Well, if you execute this script 1000 times, you would get a
> difference of 2.6 seconds?
> But if every microseconds counts for your script, then you should now
> about this.

No.

Re-read the benchmards.

At 1000 iterations you're looking at .000xx seconds.

At a MILLION iterations, you're looking at 0.xx seconds

At a TEN MILLION iterations, you've broken the 1-second barrier.

How many PHP scripts do a for or while loop 10 million iterations?

xx is either 26 or 4, depending on whose benchmarks you believe.

Running tests with 10 million iterations to benchmark is great for
removing overhead margin of error.  It's also great to look at exactly
how many times you'd have to do something to make a significant
savings.

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux