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/…
PHP 8.6 Closure Optimizations
51–53 of 53 posts
Re: PHP 8.6 Closure Optimizations
#52Re: PHP 8.6 Closure Optimizations
#53Earlier 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…