How good is PHP performance?

PHP may not be as fast as compiled server side languages, but it is still pretty fast and does the job.

The "speed" aspect of php has more to do with the user experience than with the performance itself.

AJAX applications based on PHP don't get categorized as "slow" or "unresponsive": the user has so much to do while a single request completes! Also, being "uniformly slow" with all operations is much less painful for the user than showing having erratic performance speed.

One of the previous comments has summarized it quite aptly: language don't haz speed! the application doez.

cheers, jrh


PHP's performance is fine. Unless you're designing 3d games, of course.

  1. The differences are both negligible and flame-bait. Because, really, is the Rubyism of "who cares if it's fast if it scales?" all that wrong? See #2 for an example of what slows you down.

  2. Anything that takes time. (Ironic, I know.) But really, it always depends on how you do what you do that takes the time. For instance, I can write two queries with nearly identical output but as much as a 2.5x speed increase with the better syntax/choices. By and large, the worst time-waster in a PHP script is file access ... thanks to hardware. So, the number of files you include/require slows down the script more than its contents does—especially when fragmented.

    By this simple system I've manipulated my own MVC framework to be nearly 10x the speed of a bare-boned CodeIgniter application; it's simpler and more minimalist, yes, but it should show that including 1 file, versus 1 per class, can make huge differences in speed.

  3. So long as its *AMP it's good, Linux servers will, or course, be faster. I've been satisfied with both my WAMP and LAMP system, despite vastly different hardware and software differences. (But the LAMP system is, in general, the fastest though the lesser in hardware.)


The answer to "How good is PHP performance?" is "Good enough".

By that I mean that most performance issues with Websites are related to other issues like poor database design, little to no caching, CSS/JavaScript/image caching and so on.

PHP is used by some of the largest sites on the Internet so it's passed that test. Jeff Atwood argues PHP Sucks, But It Doesn't Matter. There are things to rightly criticize PHP about (e.g., inconsistent parameter order, inconsistent function naming, magic quotes, etc) but I think he's overstating the negative.

So don't choose PHP (or not) based on supposed performance because it doesn't matter (compared to everything else).


Currently there is a project going on with the PHP developers to build better Benchmark tools for PHP.

The project leader did a talk recently on Google Techtalks called Compiling and Optimizing Scripting Languages, and it's a very interesting talk.

Also I did a PHP application size check the other day.

  • PHPBB 1.3mb
  • Joomla 6mb
  • Wordpress 11.3mb

That's data loaded into memory.