4 ms·
How is PHP's speed these days? I haven't been following but I heard that PHP has become much more capable in features and performance since I used it a decade a
by satvikpendem 2y ago
How is PHP's speed these days? I haven't been following but I heard that PHP has become much more capable in features and performance since I used it a decade ago.
- Minor49er 2y agoYes, it has come quite a ways in the last decade. Maybe you should take it for a spin
- phplovesong 2y agoSlow. Its faster than in PHP5 era, but benchmarks usually are misleading. Eg PHP does "less" making it faster for SOME tasks. If you include all unicode parsing, error handling etc PHP is still very slow. Take Go as an alternative. Has unicode etc but still lots faster than PHP.
- bornfreddy 2y agoGo is not an alternative to PHP, and I say this as someone who likes (and uses) Go. It is more performant, yes, but it is also very verbose - I would hate to develop a CRUD (web) app in it. Not to mention that any data handling is more or less manual. Great language for some services, but not for a webapp. Also PHP is far from slow. The code is precompiled ("cached") and the common operations are optimized as hell. IME the slow apps are usually just missing some MySQL indexes or similar.
- phplovesong 2y agoPHP is slow, as an example we generate (somewhat complex pdf documents from a sourced html file), and it takes PHP multiple seconds to parse and generate the document. We since rewrote this in Go and now it runs in milliseconds. This is pure CPU bound (the IO is only opening a file and not a bottleneck) and PHP is still very slow for anything more complex.
- conradfr 2y agoIt's decent enough with opcocode cache, preloading etc but not amazing. I haven't try things like FrankenPhp though.
- juangacovas 2y agoMy experience: coming from programming in C, then doing web-scripting with Perl, then PHP 4 through 5, 7 and 8 versions, it's been delightful. Big improvements in speed, ecosystem, very nice backwards compatibility in general (which is hard to do), and keeps being a flexible, multi-paradigm language. About frameworks, you can do things now like-ruby-on-rails with Laravel, like-java with Symfony, or just use any custom solution you see to fit better for team/yourself. Mantra: you can do shit code with any language, and PHP is flexible enough to let you organize projects the right way.
- ainiriand 2y agoFast if done properly, we serve around 1k rps under 50ms.
- pjmlp 2y agoWith all the stuff Facebook has made, PHP also has gotten a JIT on the standard package, I would stay it is fast enough, easily outperforming anything one would do in Python or Ruby. If you care about performance in Webapps while using dynamic languages, it is pretty much PHP or nodejs, at least until CPython and Ruby MRI JITs improve. I would have added VB.NET, but it isn't going anywhere nowadays.