Errors, warnings and performance
This site...
http://www.linuxformat.co.uk/wiki/index.php/PHP_-_Performanc e_tuning
seems to suggest that errors and warnings, even if they are suppressed,
have a performance hit.
Is this the case, and if so, what is the performance overhead likely to be?
Re: Errors, warnings and performance
turnitup <same [at] same> wrote:
> This site...
>
> http://www.linuxformat.co.uk/wiki/index.php/PHP_-_Performanc e_tuning
>
> seems to suggest that errors and warnings, even if they are suppressed,
> have a performance hit.
>
> Is this the case, and if so, what is the performance overhead likely to
> be?
Depends on the error, the amount of errors, etc.. Fact is that there's
close to none error that should be surpressed. It should simply not exist.
So check your code with full display of errors, and recitfy any mistakes
you've made or checks you missed.
--
Rik Wasmus
Posted on Usenet, not any forum you might see this in.
Ask Smart Questions: http://tinyurl.com/anel
Re: Errors, warnings and performance
turnitup wrote:
> This site...
>
> http://www.linuxformat.co.uk/wiki/index.php/PHP_-_Performanc e_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 [at]
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