php server computing

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi there!

I have a question about php server computing...
Is it more costing in ressource for a server to compute a html page
based on concatenated html strings than a html page with a few php
statements ?

I wonder that in order to make pages more efficient to compound :)

sorry for my english and thanks.


Re: php server computing

PaowZ wrote:
Quoted text here. Click to load it

The way you state it, the concatenation would take more resources, but  
the difference would be insignificant compared to bad structure and  
sloppy code.

Mostly you should do what you think is easiest to maintain, fastest to  
write or neatest.
If you think or when performance is an issue, then use a benchmark  
tool (e.g. Apaches "ab") to test different solutions. And even then,  
it is often more sensible to choose a simpler/cleaner yet adequately  
efficient solution, before the most efficient solution.

Quoted text here. Click to load it

Being mindful of efficiency is not a bad thing, but IMO you should  
forget about tinkering with ideas whether echo is faster than print,  
single quotes is faster than double quotes and the likes, unless it  
really is borderline critical. You should rather look at how you  
structure your program, which parts that is timeconsuming and how  
things should be sequenced. It can be a simple thing like writing "if  
(quick() && slow())" instead of "if (slow() && quick())".


Site Timeline