note 53925 deleted from function.echo by betz
| From: | betz@php.net | Date: | Wed, 11 Jan 2006 14:23:21 +0000 |
| Subject: | note 53925 deleted from function.echo by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-101552@lists.php.net to get a copy of this message | ||
Note Submitter: marcus at synchromedia dot co dot uk
----
The benchmark notes from 2002 don't seem to be right any more. I did some loop tests for
different kinds of output formatting in PHP 5.0.4. The numbers are the time taken for 10000
iterations:
echo 'Key is ', $k, '<br>',"\n",'Value is ', $v,
'<br><br>', "\n";
0.97371506690979
echo 'Key is ', $k, "<br>\nValue is ", $v,
'<br><br>', "\n";
0.77851700782776
echo "Key is $k<br>\nValue is $v<br><br>\n";
0.51984405517578
echo 'Key is '. $k. '<br>'."\n".'Value is '. $v.
'<br><br>'. "\n";
0.37696409225464
It seems that concatenation is way faster than multiple parameters, and interpolation is pretty good
too.