Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
aichholzer committed Oct 10, 2023
1 parent bf60a46 commit 0548a0f
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 16 deletions.
17 changes: 14 additions & 3 deletions METRICS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
# Metrics
* __Machine:__ darwin arm64 | 20 vCPUs | 64.0GB Mem
* __Node:__ `v18.12.1`
* __Run:__ Tue Oct 10 2023 14:45:12 GMT+1000 (Australian Eastern Standard Time)
* __Machine:__ linux x64 | 2 vCPUs | 6.8GB Mem
* __Node:__ `v18.18.0`
* __Run:__ Sat Oct 07 2023 05:05:29 GMT+0000 (Coordinated Universal Time)
* __Method:__ `npm run metrics` (samples: 5)
* __startup:__ time elapsed to setup the application
* __listen:__ time elapsed until the http server is ready to accept requests (cold start)

| | startup(ms) | listen(ms) |
|-| - | - |
| 1-startup-routes-schema.cjs | 136.06 | 189.55 |
| 1-startup-routes.cjs | 138.55 | 151.11 |
| 10-startup-routes-schema.cjs | 146.83 | 213.47 |
| 10-startup-routes.cjs | 142.81 | 156.85 |
| 100-startup-routes-schema.cjs | 161.09 | 327.47 |
| 100-startup-routes.cjs | 156.81 | 178.44 |
| 1000-startup-routes-schema.cjs | 399.44 | 1453.82 |
| 1000-startup-routes.cjs | 366.89 | 500.69 |
| 10000-startup-routes-schema.cjs | 8883.61 | 21110.88 |
| 10000-startup-routes.cjs | 8270.24 | 11711.95 |
| startup-listen.cjs | 147.43 | 160.15 |
47 changes: 38 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,43 @@ benchmark [arguments (optional)]
> You can also extend the comparison table with percentage values based on fastest result; `benchmark compare -p`
# Benchmarks

* __Machine:__ darwin arm64 | 20 vCPUs | 64.0GB Mem
* __Node:__ `v18.12.1`
* __Run:__ Tue Oct 10 2023 14:56:18 GMT+1000 (Australian Eastern Standard Time)
* __Machine:__ linux x64 | 2 vCPUs | 6.8GB Mem
* __Node:__ `v18.18.0`
* __Run:__ Mon Oct 09 2023 01:38:49 GMT+0000 (Coordinated Universal Time)
* __Method:__ `autocannon -c 100 -d 40 -p 10 localhost:3000` (two rounds; one to warm-up, one to measure)

| | Version | Router | Requests/s | Latency (ms) | Throughput/Mb |
| :-- | --: | --: | :-: | --: | --: |
| polka | 0.5.2 || 122736.0 | 197.81 | 21.89 |
| fastify | 4.23.2 || 121768.0 | 128.19 | 21.84 |
| rayo | 1.4.5 || 120688.0 | 126.10 | 21.52 |
| express | 4.18.2 || 25978.0 | 587.29 | 4.63 |
| | Version | Router | Requests/s | Latency (ms) | Throughput/Mb |
| :-- | --: | --: | :-: | --: | --: |
| spirit | 0.6.1 || 24812.8 | 39.89 | 4.42 |
| polka | 0.5.2 || 24653.2 | 40.06 | 4.40 |
| polkadot | 1.0.0 || 24124.0 | 40.98 | 4.30 |
| spirit-router | 0.5.0 || 23888.0 | 41.44 | 4.26 |
| bare | 10.13.0 || 23496.3 | 42.08 | 4.19 |
| fastify | 4.23.2 || 23384.4 | 42.27 | 4.19 |
| connect | 3.7.0 || 23182.4 | 42.67 | 4.13 |
| server-base-router | 7.1.32 || 22408.8 | 44.12 | 4.00 |
| connect-router | 1.3.8 || 22066.3 | 44.80 | 3.94 |
| server-base | 7.1.32 || 22018.4 | 44.91 | 3.93 |
| yeps | 1.1.1 || 21020.0 | 47.06 | 3.75 |
| vapr | 0.6.0 || 20590.0 | 48.05 | 3.38 |
| koa | 2.14.2 || 19664.7 | 50.38 | 3.51 |
| restana | 4.9.7 || 19474.7 | 50.83 | 3.47 |
| koa-isomorphic-router | 1.0.1 || 19170.1 | 51.65 | 3.42 |
| yeps-router | 1.2.0 || 19070.3 | 51.93 | 3.40 |
| h3-router | 1.8.2 || 18480.1 | 53.61 | 3.03 |
| restify | 11.1.0 || 18432.5 | 53.74 | 3.32 |
| take-five | 2.0.0 || 18265.3 | 54.23 | 6.57 |
| 0http | 3.5.2 || 18246.5 | 54.30 | 3.25 |
| koa-router | 12.0.0 || 17998.1 | 55.05 | 3.21 |
| h3 | 1.8.2 || 17740.6 | 55.87 | 2.91 |
| hapi | 21.3.2 || 17225.5 | 57.57 | 3.07 |
| fastify-big-json | 4.23.2 || 6649.9 | 149.87 | 76.51 |
| express | 4.18.2 || 5954.2 | 167.17 | 1.06 |
| express-with-middlewares | 4.18.2 || 5319.0 | 187.20 | 1.98 |
| foxify | 0.10.20 || N/A | N/A | N/A |
| galatajs | 0.1.1 || N/A | N/A | N/A |
| micro-route | 2.5.0 || N/A | N/A | N/A |
| micro | 10.0.1 || N/A | N/A | N/A |
| microrouter | 3.1.3 || N/A | N/A | N/A |
| total.js | 3.4.13 || N/A | N/A | N/A |
| trpc-router | 10.40.0 || N/A | N/A | N/A |
2 changes: 1 addition & 1 deletion benchmark-results.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"name":"polka","version":"0.5.2","hasRouter":true,"requests":"122736.0","latency":"197.81","throughput":"21.89"},{"name":"fastify","version":"4.23.2","hasRouter":true,"requests":"121768.0","latency":"128.19","throughput":"21.84"},{"name":"rayo","version":"1.4.5","hasRouter":true,"requests":"120688.0","latency":"126.10","throughput":"21.52"},{"name":"express","version":"4.18.2","hasRouter":true,"requests":"25978.0","latency":"587.29","throughput":"4.63"}]
[{"name":"spirit","version":"0.6.1","requests":"24812.8","latency":"39.89","throughput":"4.42"},{"name":"polka","version":"0.5.2","hasRouter":true,"requests":"24653.2","latency":"40.06","throughput":"4.40"},{"name":"polkadot","version":"1.0.0","hasRouter":false,"requests":"24124.0","latency":"40.98","throughput":"4.30"},{"name":"spirit-router","version":"0.5.0","hasRouter":true,"requests":"23888.0","latency":"41.44","throughput":"4.26"},{"name":"bare","version":"10.13.0","requests":"23496.3","latency":"42.08","throughput":"4.19"},{"name":"fastify","version":"4.23.2","hasRouter":true,"requests":"23384.4","latency":"42.27","throughput":"4.19"},{"name":"connect","version":"3.7.0","requests":"23182.4","latency":"42.67","throughput":"4.13"},{"name":"server-base-router","version":"7.1.32","hasRouter":true,"requests":"22408.8","latency":"44.12","throughput":"4.00"},{"name":"connect-router","version":"1.3.8","hasRouter":true,"requests":"22066.3","latency":"44.80","throughput":"3.94"},{"name":"server-base","version":"7.1.32","requests":"22018.4","latency":"44.91","throughput":"3.93"},{"name":"yeps","version":"1.1.1","requests":"21020.0","latency":"47.06","throughput":"3.75"},{"name":"vapr","version":"0.6.0","hasRouter":true,"requests":"20590.0","latency":"48.05","throughput":"3.38"},{"name":"koa","version":"2.14.2","requests":"19664.7","latency":"50.38","throughput":"3.51"},{"name":"restana","version":"4.9.7","hasRouter":true,"requests":"19474.7","latency":"50.83","throughput":"3.47"},{"name":"koa-isomorphic-router","version":"1.0.1","hasRouter":true,"requests":"19170.1","latency":"51.65","throughput":"3.42"},{"name":"yeps-router","version":"1.2.0","hasRouter":true,"requests":"19070.3","latency":"51.93","throughput":"3.40"},{"name":"h3-router","version":"1.8.2","hasRouter":true,"requests":"18480.1","latency":"53.61","throughput":"3.03"},{"name":"restify","version":"11.1.0","hasRouter":true,"requests":"18432.5","latency":"53.74","throughput":"3.32"},{"name":"take-five","version":"2.0.0","hasRouter":true,"requests":"18265.3","latency":"54.23","throughput":"6.57"},{"name":"0http","version":"3.5.2","hasRouter":true,"requests":"18246.5","latency":"54.30","throughput":"3.25"},{"name":"koa-router","version":"12.0.0","hasRouter":true,"requests":"17998.1","latency":"55.05","throughput":"3.21"},{"name":"h3","version":"1.8.2","requests":"17740.6","latency":"55.87","throughput":"2.91"},{"name":"hapi","version":"21.3.2","hasRouter":true,"requests":"17225.5","latency":"57.57","throughput":"3.07"},{"name":"fastify-big-json","version":"4.23.2","hasRouter":true,"requests":"6649.9","latency":"149.87","throughput":"76.51"},{"name":"express","version":"4.18.2","hasRouter":true,"requests":"5954.2","latency":"167.17","throughput":"1.06"},{"name":"express-with-middlewares","version":"4.18.2","hasRouter":true,"requests":"5319.0","latency":"187.20","throughput":"1.98"},{"name":"foxify","version":"0.10.20","hasRouter":true,"requests":"N/A","latency":"N/A","throughput":"N/A"},{"name":"galatajs","version":"0.1.1","hasRouter":true,"requests":"N/A","latency":"N/A","throughput":"N/A"},{"name":"micro-route","version":"2.5.0","hasRouter":true,"requests":"N/A","latency":"N/A","throughput":"N/A"},{"name":"micro","version":"10.0.1","requests":"N/A","latency":"N/A","throughput":"N/A"},{"name":"microrouter","version":"3.1.3","hasRouter":true,"requests":"N/A","latency":"N/A","throughput":"N/A"},{"name":"total.js","version":"3.4.13","hasRouter":true,"requests":"N/A","latency":"N/A","throughput":"N/A"},{"name":"trpc-router","version":"10.40.0","hasRouter":true,"requests":"N/A","latency":"N/A","throughput":"N/A"}]
6 changes: 3 additions & 3 deletions benchmarks/rayo.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

async function run() {
const { default: rayo } = await import('rayo');
async function run () {
const { default: rayo } = await import('rayo')

const app = rayo({ port: 3000 })

Expand All @@ -13,4 +13,4 @@ async function run() {
app.start()
}

run()
run()

0 comments on commit 0548a0f

Please sign in to comment.