Do you have a question? Post it now! No Registration Necessary. Now with pictures!
September 9, 2005, 6:40 pm
rate this thread
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
I wonder that in order to make pages more efficient to compound :)
sorry for my english and thanks.
Re: php server computing
The way you state it, the concatenation would take more resources, but
the difference would be insignificant compared to bad structure and
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.
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())".