Closed henrywood closed 1 month ago
Hi, KPHP
needs to do a lot of work on initialization. That's why in some cases it may be slower that plain PHP
. You may take a look at dedicated page about benchmarking KPHP
: https://vkcom.github.io/kphp/various-topics/walk-through-php-kphp-cpp.html
Thank you for the reply.
Because I did a benchmark for Swoole last year, I thought I would try to do a similar one for KPHP.
The Swoole benchmark showed between 330000-360000 requests per second on my small laptop for a simple "HELLO" HTTP webserver.
So I compiled this code:
which does the same thing as the Swoole benchmark (although a bit more involved when using Swoole)
Compiling it with:
Running it with:
Running the benchmark:
Here are the results
It looks like KPHP is a full 7 times slower than Swoole+PHP ???
I did not expect this ?
I know that this is a simple I/O-bound test and I would expect benchmarks to be more equal when doing CPU-bound work ?
(Remember that Swoole is a PHP extension) but when running it is just plain uncompiled PHP)
Any ideas why KPHP is this much slower ???