PHP Performance Debate
The cluster focuses on debates about PHP's speed and performance, including comparisons to languages like Python, Elixir, Ruby, and Java, defenses of modern PHP (e.g., PHP7) with opcode caches, and critiques of frameworks.
Activity Over Time
Top Contributors
Keywords
Sample Comments
Nope. Php is sufficiently fast.
Are there any numbers on performance vs php itself?
Isnβt modern PHP much faster though?
I don't buy the whole "slow" thing. I work on a very popular SaaS web app, written in PHP, that is running on far fewer frontend web servers than I've seen running other sites with fewer users written in other languages.With an Opcode cache (available shipped since 5.5) it's perfectly fine performance wise.
Can't say for sure, but in PHP some modules are writted in C and optimized, it might be that you are seeing that. Overall PHP due to number of things, how collections are processed etc is very slow.Elixir/Phoenix is pretty much consistently fast and encourages practices that I believe will make your app really fast.
PHP is just a thin layer on top of C. Of course it will perform decently. PHP frameworks are usually designed in a dumb way and thus perform badly. Usually they load all or most of their files into memory with every request, even though only couple files would be enough.
If you're comparing something to PHP's speed, you've already lost.
The difference in speed between Python and PHP should not be a deciding factor in choosing between the two web frameworks. Many of the core PHP functions are implemented in C directly, so they are very fast, but once you add a framework into the mix, speed drops off considerably because it seems the PHP interpreter is not so good.
There is no right answer. Despite what others say, php is perfectly suited for a lot of needs. Runtime may be your issue, but you also have to think of supportability.If your looking to optimize your site, as messenlinx suggested yslow is a good place to start. Next, I would suggest looking at your queries, ie a select statement across a big table vs. a more refined query across a smaller data set will do wonders regardless of the language.If your data is updated infrequently, you can look
If you're serving only json snippets from memory and might have hundreds of simultaneous users, yes!If you have existing sites built with it which work fine, then this benchmark doesn't tell you a great deal other than that php is relatively slow, and frameworks built upon it slower. For many websites which have a caching strategy sitting behind a server like apache or nginx and less than a few thousand users a day, this really doesn't matter, and other things like features are more important