Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How good is PHP performance?

This is a follow up to a recent post I've seen which suggests that PHP performance is poor:

"PHP. IS. ALWAYS. THE. BOTTLENECK. My server farms, let me show you them! PHP Overall Performance"

followed by:

"PHP performance is frickin' abysmal. I am basing this on my experience with OpenX (on Linux) and WordPress (on win64)."

Can we get some objective community input as to whether PHP performance is good, or bad ...

  1. Compared to other languages / runtimes
  2. From a language perspective, are there any specific libraries or operations which are better or worse than others?
  3. From a build perspective are there any versions, or platforms which are better or worse than others?
like image 617
Andrew Whitehouse Avatar asked May 18 '09 15:05

Andrew Whitehouse


People also ask

Is PHP fast enough?

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.

Why is PHP so fast?

PHP codes runs much faster than ASP because it runs in its own memory space while ASP uses an overhead server and a COM based architecture. Less Expensive Software – In working with PHP, most tools associated with the program are open source software, such as WordPress, so you need not pay for them.

Is PHP slower than Java?

Java is supposed to be faster than any other programming language based on its design and architecture, but PHP runs the quick development race when executed.

Is go faster than PHP?

Go is faster and more efficient than PHP in this regard but also has a steeper learning curve. However, if speed is most important to you when developing an app, Go would be better. To get the best results, you can also hire Golang developers. Go is gaining in popularity as a language for security specialists.


1 Answers

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).

like image 158
cletus Avatar answered Sep 20 '22 15:09

cletus