----- Original Message -----
From: "Stut" <stuttle@xxxxxxxxx>
To: "Satyam" <Satyam@xxxxxxxxxxxxx>
Cc: <php-general@xxxxxxxxxxxxx>
Sent: Monday, September 11, 2006 6:32 PM
Subject: Re: Re: Newbie question about <?= ?>
Satyam wrote:
I admit I'm totally surprised about the buffered results. Nevertheless,
may I sugest you add the following to the series of tests?:
<h3>Using line-by-line single-quoted echo<br/>with comma separated
arguments</h3>
<snip>
There seems to be one thing rarely anybody remembers, echo admits
multiple arguments, and as the numbers will show, (or at least they do in
my machine), they are the second best option.
Done, but again it doesn't seem to make any significant difference to the
performance.
-Stut
When I run those tests locally, the numbers are totally different and the
performance of one over the other comes out far clearer. I can only assume
that the numbers in the test run in a remote server are so much influenced
by the ability of the server to push out the characters into the output
stream that the processing time itself is of very little relevance. This
table shows the numbers for the different tests as run on my machine,
locally (where output streaming is irrelevant) and run from your site:
Using <?=$x?> Took 0.2801 seconds Took
3.5937 seconds
Using <?php print $x; ?> Took 0.3286 seconds Took 5.2654 seconds
Using line-by-line single-quoted print: Took 0.1215 seconds Took
3.2256 seconds
Using line-by-line single-quoted echo
with comma separated arguments Took 0.2542 seconds Took 3.2220
seconds
Using line-by-line double-quoted print Took 0.1782 seconds Took
3.3129 seconds
Using buffered single-quoted print Took 0.0277 seconds Took 3.3077
seconds
Using buffered double-quoted print Took 0.2038 seconds Took 3.3012
seconds
It would seem that it takes about 3 seconds to push those bytes into the
network, the actual processing times get completely masked behind a simple
glitch in the throughput of the communication line. While the differences
on the rightmost column (except for the second one, which is way off) are no
more than 5%, in the middle column the differences are up to 10 to 1. But
then there is that second row, which is so much higher and it is so in both
columns.
Unfortunately, I cannot make much sense about all this. I don't get it.
Nevertheless, something it is clear is that buffering all the output first
and then pushing it out all at once seems to beat them all, specially using
single quoted strings. Run locally, the differences are amazing!
Satyam
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php