You are here: Re: Errors, warnings and performance « All PHP « IT news, forums, messages
Re: Errors, warnings and performance

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация