What many people miss is that very few projects ever cross that threshold.
Kind of like a table saw vs a CAD router.
What many people miss is that very few projects ever cross that threshold.
Kind of like a table saw vs a CAD router.
With php, I have to do stuff like caching responses with apcu to get something similar, but inferior. Which doesn't scale beyond a single server host.
I can serve a lot of requests with apcu, but the curve does drop off at some point.
Both should be able to scale well in a "create a website and return the HTML"-scenario, and it's not unlikely that a PHP setup would be faster.
In a single page app thats mostly based on fetching data from an API nodejs would probably be faster.
About APCu: It's damn fast and very unlikely to slow you down, other stuff will probably bottleneck you way before APCu becomes a problem.
Use PHP as PHP, and nodejs as nodejs.
If you really need async in PHP or want to use PHP somewhat like nodejs then you should probably go for an extension and serve requests directly from PHP. I've had great experiences with that, serving over 500K simple HTTP req/s on a low end server.
But again, if max performance on a single server is so important then you should probably go for a compiled language anyways.
Often the answer is "it depends". Which is usually unsatisfactory for the HN crowd.
I just hate uninformed and unnuanced PHP hating.
There are use cases where it's actually the best answer by a large degree.