Install
$> npm i -g @rayo/benchmarks
Run
$> rayobench
$> rayobench -- -u http://localhost:5050 -c 1000 -p 25 -d 10
-u
(url) -Defaults to http://localhost:5050
-c
(connections) -Defaults to 500
-p
(pipelines) -Defaults to 10
-d
(duration) -Defaults to 5
(seconds)
-o
(only) Run only one particular benchmark. -Defaults to null
-w
(workers) The number of workers to run the benchmarks. -Defaults to cpu count
Results may will vary on different hardware.
How does it compare?
Please note that these results are only meant as raw performance indicators. Your application's logic, which is what makes most applications slow, may not see great performance gains between frameworks.
These tests were conducted on Mac Studio (M1 Ultra, 64 GB RAM, 20 CPU) and Node.js v16.18.1.
Measured after one warm-up run.
Tested with:
500 connections,
20 pipelines,
5 seconds,
20 CPU cores.
ββββββββββββββ¬ββββββββββ¬βββββββββββββ¬βββββββββββββ¬ββββββββββββ¬βββββββββββββββ
β β Version β Reqs/sec ^ β Reqs/sec * β Latency * β Throughput * β
ββββββββββββββΌββββββββββΌβββββββββββββΌβββββββββββββΌββββββββββββΌβββββββββββββββ€
β Storm β 1.3.0 β 226325 β 213081.6 β 23.05 β 29.46 Mb. β
ββββββββββββββΌββββββββββΌβββββββββββββΌβββββββββββββΌββββββββββββΌβββββββββββββββ€
β Rayo β 1.4.0 β 127765 β 125267.2 β 39.24 β 17.32 Mb. β
ββββββββββββββΌββββββββββΌβββββββββββββΌβββββββββββββΌββββββββββββΌβββββββββββββββ€
β Polka β 0.5.2 β 126479 β 122886.4 β 38.22 β 16.99 Mb. β
ββββββββββββββΌββββββββββΌβββββββββββββΌβββββββββββββΌββββββββββββΌβββββββββββββββ€
β Fastify β 4.10.2 β 122810 β 121273.6 β 40.6 β 21.63 Mb. β
ββββββββββββββΌββββββββββΌβββββββββββββΌβββββββββββββΌββββββββββββΌβββββββββββββββ€
β Express β 4.17.1 β 37094 β 36035.2 β 135.91 β 4.98 Mb. β
ββββββββββββββ΄ββββββββββ΄βββββββββββββ΄βββββββββββββ΄ββββββββββββ΄βββββββββββββββ
* Average
When Rayo
is powered by Storm
, it relies on Nodejs' cluster
which will spawn a server process on each available CPU core, thus yielding better results.
Missing a framework?
Just submit a PR with whatever framework you consider is worthy of being ranked here.
License
MIT