Re: Re: Newbie question about <?= ?>
| From: | Satyam | Date: | Mon, 11 Sep 2006 19:24:00 +0000 |
| Subject: | Re: Re: Newbie question about <?= ?> | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-241621@lists.php.net to get a copy of this message | ||
----- Original Message ----- From: "Stut" <stuttle@gmail.com>
To: "Satyam" <Satyam@satyam.com.ar>
Cc: <php-general@lists.php.net>
Sent: Monday, September 11, 2006 6:32 PM
Subject: Re: [PHP] Re: Newbie question about <?= ?>
Satyam wrote: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:I admit I'm totally surprised about the buffered results. Nevertheless, may I sugest you add the following to the series of tests?:Done, but again it doesn't seem to make any significant difference to the performance. -Stut<h3>Using line-by-line single-quoted echo<br/>with comma separatedarguments</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.
Using <?=$x?> Took 0.2801 seconds Took3.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 Took3.2256 seconds Using line-by-line single-quoted echo
with comma separated arguments Took 0.2542 seconds Took 3.2220seconds
Using line-by-line double-quoted print Took 0.1782 seconds Took3.3129 seconds
Using buffered single-quoted print Took 0.0277 seconds Took 3.3077seconds
Using buffered double-quoted print Took 0.2038 seconds Took 3.3012seconds 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