Closed kocoten1992 closed 3 years ago
it is true. workerman is better to traditional phper!🤣🤣🤣🤣🤣
You are using swoole under the hood - so how is this possible ?
Although workerman supports swoole as the underlying driver, but the above benchmark workerman did not use swoole.
I don't know why workerman performs better than swoole. It may be that swoole's internal implementation is more complex, which affects its performance.
You are testing Swoole only for http (plain requests / response) layer, without using coroutines to multiplex other I/O like Database, Redis, System Process/ Commands.
Plus, after frameworks achieves performance upto a certain level, we seek a best trade-off (equilibrium) between Performance and Featrues. Swoole certainily has all futuristic scalable modern Features required modern Applications like IoT, Real-time Network Communication, In-memory / Memory-first Architecture, Games and other Micro-services based on Communicating Sequential Process (CSP) model of Concurrent Programming.
In my personal opinion, the questions to ask before choosing "Workerman" over "Swoole" are:
Does the Workerman allows writing elegant, modern and lighting fast Coroutines (also called as "Green Threads', or "Fibers") in order to perform operations asynchronously on each user request ? The real power (and, Performance) of Swoole comes with its Coroutines and Channels. This is what Benchmarks can not show.
Does the Workerman creates multiple Reactor-threads within each Service ? in order to maintain a balance between low-load (or, slow) connections and high-load connections ? OR, it just works like NodeJS (with single-Reactor Thread per server) where a slow connection and/or response causes all user connections (users requests) to wait. Swoole's Master Process initiates multiple Reactor-threads.
Does the Workerman allows an elegant way for CPU-intensive (or, long running tasks) to be spawned in a separate "Task Worker Process"? in order to be able to run such tasks asynchronously and parallely ? so that CPU-intensive tasks do not hinder I/O-bound operations. Swoole allows that bifurcation with one line elegant code.
Does the "Workerman" provides an elegant way to spin background Processes (Daemons), dynamically (at run time) ? to enable Parallel Processing (with a Time ticker with millisecond intervals) replacing highly inefficient process of creating inefficient Crons.
Does the Workerman provides client-side implementations for all of the Network Protocols ? that Swoole provides.
Hello, I saw benchmark on https://www.techempower.com/benchmarks/#section=data-r19&hw=ph&test=plaintext
workerman: 25% swoole: 15%
I dont believe it so I wrote a script (below) to test it myself:
Result
It is true - but how :smiley: ? You are using swoole under the hood - so how is this possible ?