note 60574 added to function.echo
| From: | supportatsaschaminusdiebeldotde at osu1 dot php dot net | Date: | Wed, 11 Jan 2006 13:00:07 +0000 |
| Subject: | note 60574 added to function.echo | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-101548@lists.php.net to get a copy of this message | ||
My benchmark was running on Apache/2.0.55 (Unix) PHP/5.1.1:
I took 150000 iteration and saved the results in the session for multiple requests. the results are
the intersection of quite a lot requests. the benchmark times were constant and show
echo 'Key is ', $k, '<br>',"\n",'Value is ', $v,
'<br><br>', "\n";
0.138133585453
echo 'Key is ', $k, "<br>\nValue is ", $v,
'<br><br>', "\n";
0.114041343331
echo "Key is $k<br>\nValue is $v<br><br>\n";
0.49078194797
echo 'Key is '. $k. '<br>'."\n".'Value is '. $v.
'<br><br>'. "\n";
0.199534930289
It shows that the fastest way to put content is to echo with multiple parameters and as possible no
interpolation.
----
Manual Page -- http://www.php.net/manual/en/function.echo.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60574
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60574&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60574&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60574&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60574&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60574&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60574&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60574&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60574&report=yes
Search -- http://master.php.net/manage/user-notes.php