2 ms·
That's true in a thread oriented environment; but it's not the case in a traditional PHP environment, with one OS process per client. A PHP process does not kno
by toast0 9y ago
That's true in a thread oriented environment; but it's not the case in a traditional PHP environment, with one OS process per client. A PHP process does not know how to context switch between many requests; if the process is waiting for I/O the OS will schedule a different process. In this model, sending multiple backend requests concurrently, regardless of how, is of value when it lowers the total request time and lets it accept another request sooner.
You can send requests to the backend through async/await language features, or more simply by using apis that separate sending a request from waiting for a response, assuming network buffers are large enough to enqueue the request(s) without blocking.