Is PHP really that slow?

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

99% of all Webpages out there don't need request per second optimization. And if they are slow it is mostly caused by slow database queries

shockgonewild
Автор

Swoole is goated. Laravel supports it directly via Octane.

Refresh
Автор

bruh phps builtin server is designed to be single threaded, its not production ready by any means
you shouldve benchmarked php using nginx+php-fpm for apples-to-apples comparison

ddruganov
Автор

This is like the movies where the protagonist takes the gun from the bad guys and shoots them while they're watching.

j.r.r.tolkien
Автор

How many apps out there need to handle more than 500 requests per s ? Some people think like they are building Google when they make the webstore of a small shop

skybluFr
Автор

Using PHP's built-in server is not so fair :D

abdulkadircemiloglu
Автор

Why so many hates against php? People are going crazy just because modern php is still performing well. They wanna barry the language but you'll be barred before its death 😅😅. Laravel 11 is a super power 😊😊

mouctechy
Автор

Why not test php-fpm as well? Something with pm static, pre-loaded opcache and JIT configured to compile everything. The local server was never meant for anything but fast testing

dimitris
Автор

If you use an optimized middleware solution written in c++, you can’t really compare it anymore. Something with apples and oranges.

martijn
Автор

Here I have to welcome Bun. Without express everything is faster in node

iftekharhossen
Автор

People are so mad because you made a good point about php lol. They can't accept the fact that php CAN be faster like other languages that are naturally fast

soldierbirb
Автор

Way more than Node? You sure about that?

With FastifyJS you get 44, 437 requests / sec.
KoaJS can give you 34, 123 requests / sec.

Express is literally one of the slowest http library in NodeJS.

Of all the available libraries you picked one of the slowest and compared the fastest php you know only to justify that php is fast -- faster than Node and Go.

aprilmintacpineda
Автор

Hi, Andrew, can you record a practical lesson about openswoole

zuldisy
Автор

In my tests:
rust (axum) perform 49k request/sec with a transfer speed of 7.74 mb/s
nodejs (express) perform 14, 5k req/sec with a transfer speed of 4.04 mb/s
bun (express) perform 25.3k req/sec with a transfer speed of 5.92 mb/s

glydric
Автор

can you repeat this with pm2? Node has async properties but main thread still single.

erkintek
Автор

this also opens a whole can of worms if you are not careful, memory leaks, weird state issues. You have to be very very very careful especially if you are using 3rd party packages also. php was built upon the shared nothing arhitecture runtime.

CaimAstraea
Автор

Isn't openswoole written in C++? Would mean that you're comparing php with node and go and than come to the conclusion that C++ is faster than all of them.
Great Job.

thejezzi
Автор

If PHP had static types, do it will be even faster than Swoole? 🤔 Need to perform the same benchmark on KPHP (PHP to C++ transpiler with strict types in mind)

rbars
Автор

Haha love the name of that php lib! Do you have a repo with these scripts and the json file? I'd love to do some experiments myself :)

flyingsquirrel
Автор

now we can be extremely productive w/ PHP and still speed up the server later if we need. Awesome

ThePandaGuitar