|
Posted by J.O. Aho on 03/10/07 16:10
turnitup wrote:
> This site...
>
> http://www.linuxformat.co.uk/wiki/index.php/PHP_-_Performance_tuning
>
> seems to suggest that errors and warnings, even if they are suppressed,
> have a performance hit.
Yes, the function will still throw out the error message, it's just that the @
will prevent it to be sent to the buffer.
> Is this the case, and if so, what is the performance overhead likely to be?
Slightly more than:
echo <<<EOF
Warning: include(thefile): failed to open stream: No such file or directory in
/t.php on line 2
Warning: include(): Failed opening 'thefile' for inclusion
(include_path='.:/usr/share/php5:/usr/share/php') in /t.php on line 2
EOF;
You have to have quite a lot of errors/warnings before you start to notice
anything.
--- example1 ---
<?PHP
echo "Result is: ";
$omthing=1;
echo $omething;
?>
--- eof ---
--- example2 ---
Result is:
<?PHP
$omthing=1;
echo $omething;
?>
--- eof ---
In the same way example1 is slower than example2, but you won't notice it
until you done it 100000 times on the same script.
--
//Aho
Navigation:
[Reply to this message]
|