3 ms·
Faster? LOL! Need speed? Use a compiled language. I rarely see a tool written in, say, python slow for what it was written for. From a user point 5ms vs 9ms in
by phplovesong 5y ago
Faster? LOL! Need speed? Use a compiled language. I rarely see a tool written in, say, python slow for what it was written for. From a user point 5ms vs 9ms in irrelevant.
With PHP the speed should not be CPU related, but instead IO. PHP IO is HORRIBLE, and a default setup using framework <insert here> usually peaks around 300-600 req/sec which is almost laughable in 2021.
Not that it really matters, but for CPU stuff numpy is multitudes faster than a PHP counterpart. Pypy also usually is lots faster than PHP for a given task.
- NorwegianDude 5y ago300-600 req/sec with a default setup? That seems a bit low, unless it's a very slow framework or machine. Most frameworks are slow, but not that slow. I think ~2K+ rps was what I got when I did a comparison last year. But, PHP IO is slow? What do you mean by that? A lot of things in PHP is basically just a wrapper for C, and it's really fast. I'm really interested in why you think IO is slow.
- phplovesong 5y agoThe way PHP is built (start and die) on each execution. Compared to anything else, thats "running" PHP needs to do more work on each startup. This is also why its impossible to build a websocket server in PHP (without hacks like reachphp). this is one of the main reasons PHP IO (read req/res) is slow. You can search for benchmarks if you so choose, and a basic setup for PHP is usually in the 300-600 req/sec range.