News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Gonzalo Ayuso's Blog:
Checking the performance of PHP exceptions
January 17, 2012 @ 08:02:24

Gonzalo Ayuso has a new post to his blog today looking at the performance of PHP exceptions and how it could effect your application's overall speed.

Sometimes we use exceptions to manage the flow of our scripts. I imagine that the use of exceptions must have a performance lack. Because of that I will perform a small benchmark to test the performance of one simple script throwing exceptions and without them.

His (little) benchmarking scripts are included - both looping 100000 times, one throwing an exception and the other not. The results were pretty obvious - the memory usage was about the same but the speed was about ten times faster without the exceptions (in PHP 5.3). In PHP 5.4, however, the numbers were closer as far as time to run. Obviously, unless you make super heavy use of exceptions, you're not even going to come close to something like this (micro-optimization anyone?).

0 comments voice your opinion now!
exception performance benchmark execution time memory


blog comments powered by Disqus

Similar Posts

Terry Chay's Blog: How much does a date() cost?

Michael Bommarito\'s Blog: Day Three - PHP5 vs PHP6 Benchmark

HowToForge.com: Running Apache2 With PHP5 And PHP4 At The Same Time

dynaTrace Blog: Top 10 Performance Problems taken from Zappos, Monster, Thomson and Co

Rob Allen's Blog: PHP 5.3 is quicker than PHP 5.2


Community Events

Don't see your event here?
Let us know!


development interview wordpress language unittest release introduction community series api psr7 laravel5 extension opinion podcast framework voicesoftheelephpant library conference laravel

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework