Re: Phux - High Performance PHP Router
| From: | Yo-An Lin | Date: | Mon, 06 Jan 2014 12:42:22 +0000 |
| Subject: | Re: Phux - High Performance PHP Router | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-322633@lists.php.net to get a copy of this message | ||
Here is the benchmark details, you can find the benchmark code below:
https://github.com/c9s/router-benchmark
on intel xeon 16 cores machine:
symfony/routing only got 4873.17 #/sec while phux got 16777.12 #/sec
on intel core i5 machine:
symfony/routing only got around 200-300 #/sec while phux got around 1600-1800 #/sec
Also the pure php dispatch benchmark:
cat dispatch.txt
n=10000
Runing symfony/routing - . 6664.4093423989/s
Runing phux extension - . 16501.898328291/s
Rate Mem phux extension symfony/routing
phux extension 16K/s 5M -- -40%
symfony/routing 6K/s 786K 247% --
================================== Bar Chart ==================================
phux extension 16K/s |
████████████████████████████████████████████████████████████
|
symfony/routing 6K/s | ████████████████████████
|
============================== System Information ==============================
PHP Version: 5.5.6
CPU Brand String: Intel(R) Core(TM) i5-2400S CPU @ 2.50GHz
On 2014/1/6, at 下午12:36, Yo-An lin <cornelius.howl@gmail.com> wrote:
> Yeah I know, the benchmark is pretty rough. Because its a two day work. :p
>
> The details will come up later.
>
> [Sent from iPhone]
>
> Sebastian Krebs <krebs.seb@gmail.com> 於 2014/1/6 7:54 寫道:
>
>>
>>
>>
>> 2014/1/5 Lin Yo-An <cornelius.howl@gmail.com>
>> Hi folks,
>>
>>
>> Glad to announce that the first version of Phux PHP Router is released.
>>
>> https://github.com/c9s/phux
>>
>>
>> Phux is basically a rewrite of PHP Roller router.
>>
>> Phux provides full functional C extension and pure PHP library with the
>> same interface, so the extension is optional to install.
>>
>> but if you install phux extension, you may enjoy the performance of routing.
>>
>>
>>
>> Route Dispatch Benchmark (Symfony/Routing and Phux pure PHP)
>>
>> https://raw.github.com/c9s/Phux/master/benchmarks/reqs.png
>>
>> Hi,
>>
>> Not a comment about Phux directly, but I think I have to point this out (sadly: once more):
>> When you use Apache Benchmark to benchmark the performance of an PHP-component, you in fact
>> benchmark your system... [1] Another flaw is, that the whole benchmark setup is missing, which makes
>> it slightly suspicious and unreliable. Two things, that spontanous came into my mind
>>
>> - Because you use ab to benchmark it is unlikely, that the S2-setup contains the
>> routing-component only. This means, that in this benchmark you measure more than just the routing.
>> OK, the README states, that "Testing with route dispatch only. (no controller)", but
>> information on how do the benchmarks setup the routing is missing.
>> - Like so many other benchmarks improvments, that every S2-application relies in production
>> on, are probably missing. Do you compile the routing-table from a config into PHP? Do you use APC?
>> While it sounds totally fair to compare two bare setups, it isn't. It probably ignores
>> customizations, that are possible in one, but not the other and that affects the outcome. Most
>> obvious example is what I mentioned: Parsing a YAML, generating the routing table and routing is
>> something very different than reading the routing-table from an APC-cached PHP-file and routing.
>>
>> I don't say Phux is bad or something, but my advice is to rework the benchmark and
>> publish the setup. Beside this I am more interested in benchmarks of the C-extension (especially
>> against the native-PHP solution) :)
>>
>> Regards,
>> Sebastian
>>
>>
>> [1] The worst thing about this, is that you not only benchmark the target system, but the
>> benchmark also relies heavily on the local one. Even worse than worse: Running both on the same
>> machine let them affect each other in a non-predictable way. You get numbers, but you can never
>> tell, what they mean.
>>
>>
>>
>>
>>
>> Cheers,
>>
>> Yo-An Lin
>>
>>
>>
>> --
>> github.com/KingCrunch