I fell for this some time ago - but the trick is that
1. You don't do for ($i=0; $i<99999999999; $i++) { echo "Line $i<br>\n"; 
} in real life - you do stuff, call object methods, run queries, 
whatever, and in between those you have both html and php - and the 
remote machine waits for you to do all the "extra" stuff and _then_ 
waits for you to switch in and out of php for several times. I'm 
thinking about switching in and out of php in a "really-mixed" context - 
such as having blocks of html inside if() and while() blocks, stuff like 
that where you get to parse quite a number of php tags.
2. Your server doesn't only serve one client at a time - I'm surprised 
that you're starting with commercial sites and this piece of information 
isn't *always* present in your mind.

However, as I said in my original mail, "there's an urban legend saying 
that [...] I don't know if that's true". So... I don't know if it 
actually slows things down or not.

Bogdan

Marcelo Leitner wrote:

>On Mon, Jun 03, 2002 at 03:16:10AM +0300, Bogdan Stancescu wrote:
>  
>
>>2. Speed
>>There's an urban legend saying that switching php tags on and off would 
>>slow parsing down. I don't know if that's true and try to write "pure" 
>>php as you call it due to the first reason.
>>    
>>
>
>I don't mind about this.. I'm starting with comercial pages now and before that
>I noted that any script you run at the server, you will only see this latency
>if the output is buffered or you have a ultra-fast machine with a
>super-powerfull navigator that can renderize the page before it's fully sent to
>the browser..
>Try doing something like for ($i=0; $i<99999999999; $i++) { echo "Line $i<br>\n"; }
>Run the script in one machine and the browser at another.. you'll see that the
>client machine has the cpu burned much more then the server..
>You can see this when you're trying to open that big-flat-forums
>all-in-one-page.. you'll get sometime 1. to receive that, 2. to renderize..
>Note that you can only see the renderizing time if you're on a fast connection..
>
>What I do take care is about excessive database searchs.. that can slow down
>the things since I'll probably will not have a reserved server..
>
>  
>
>>Bogdan
>>    
>>
>---end quoted text---
>
>[]'s
>  
>




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

Reply via email to