Re: [PHP] Re: optimilize web page loading
- From: news@xxxxxxxxxxxxx (Al)
- Date: Thu, 27 Mar 2008 10:54:13 -0400
Good point. I usually do use the single quotes, just happened to key doubles for the email.
Actually, it's good idea for all variable assignments.
Philip Thompson wrote:
On Mar 26, 2008, at 6:28 PM, Al wrote:.Depends on the server and it's load. I've strung together some rather large html strings and they aways take far less time than the transient time on the internet. I used to use OB extensively until one day I took the time to measure the difference. I don't recall the numbers; but, I do recall it was not worth the slight extra trouble to use OB.
Now, I simple assemble by html strings with $report .= "foo"; And then echo $report at the end. It also makes the code very easy to read and follow.
You might as well take it a step further. Change the above to:
$report .= 'foo';
This way for literal strings, the PHP parser doesn't have to evaluate this string to determine if anything needs to be translated (e.g., $report .= "I like to $foo"). A minimal speedup, but nonetheless...
~Philip
Andrew Ballard wrote:On Wed, Mar 26, 2008 at 1:18 PM, Al <news@xxxxxxxxxxxxx> wrote:You are really asking an HTML question, if you think about it.Yes, but do so smartly. Excessive string concatenation can slow things
At the PHP level, either use output buffering or assemble all your html string as a variable and
then echo it. The goal is to compress the string into the minimum number of packets.
down as well. On most pages you probably won't notice much difference,
but I have seen instances where the difference was painfully obvious.
Andrew
- Follow-Ups:
- Re: [PHP] Re: optimilize web page loading
- From: Shawn McKenzie
- Re: [PHP] Re: optimilize web page loading
- References:
- optimilize web page loading
- From: "Alain Roger"
- Re: optimilize web page loading
- From: Al
- Re: [PHP] Re: optimilize web page loading
- From: "Andrew Ballard"
- Re: [PHP] Re: optimilize web page loading
- From: Al
- Re: [PHP] Re: optimilize web page loading
- From: Philip Thompson
- optimilize web page loading
- Prev by Date: Re: [PHP] How to install PHP 5.x on Windows Server 2000 with IIS 5and MySQL 5.x
- Next by Date: Re: [PHP] WAMP servers
- Previous by thread: Re: [PHP] Re: optimilize web page loading
- Next by thread: Re: [PHP] Re: optimilize web page loading
- Index(es):
Relevant Pages
|