Live data from Hacker News

PHP 8.6 Closure Optimizations

wiki.php.net

51–53 of 53 posts

Re: PHP 8.6 Closure Optimizations

#51
post #36

Earlier quoted context omitted.

I feel like I'm on a different planet when I see this kind of comment. What if you need to call multiple external APIs at once with complex json? Sure you can call them one after another, but if each take (say) 2s to return (not uncommon IME), then you are in real trouble with only one thread - even if it is just for one "request". I guess I'm spoilt in .NET with Task.WhenAll which makes it trivial to do this kind of…

> What if you need to call multiple external APIs at once with complex json? A few years ago, I had a PHP project that had grown by accretion from taking a single complex input and triggering 2-3 external endpoints to eventually making calls to about 15 sequentially. Processing a single submission went from taking 5-10 seconds to over five minutes. This was readily solved by moving to ReactPHP ( https://reactphp.org/…

[dead]

Re: PHP 8.6 Closure Optimizations

#52

Earlier quoted context omitted.

PHP was not designed

not designed, it was destined

It was just a really good timing. The web 1.0 was just getting popular. And now 30 years later, we still suffer from this "timing". Luckily there is so many better alternatives in 2026.

Re: PHP 8.6 Closure Optimizations

#53
post #19
post #16

Earlier quoted context omitted.

PHP's performance can be significantly lower than JS, because it doesn't have application state (in a standard runtime/setup) and needs to re-run the entire application for every request. Now there are a whole bunch of tricks both in the language and with tooling to alleviate that, but still it's inherently there. It's an advantage for other reasons though.

There are advantages to the lack of application state, though. Memory leaks and similar bugs became largely irrelevant, for instance. Regarding performance, a simple LAMP stack on a dedicated machine can easily give you <250ms pageloads for many web apps. If that's not fast enough, or you're averaging dozens or hundreds of requests per second, you're probably big enough that you can use parallelization or more exotic…

A simple LAMP stack can give you <1ms page loads for most applications. Even 15 years ago you could serve over 100k/rps of lightweight PHP pages from a low end server.
Post reply on HN