diff --git a/README.md b/README.md index d1f55c7f..c687a827 100644 --- a/README.md +++ b/README.md @@ -42,27 +42,52 @@ benchmark [arguments (optional)] * __Method:__ `autocannon -c 100 -d 5 -p 10 localhost:3000` (two rounds; one warm-up, one to measure). * __Node:__ `8.11.2` -  | Version | Router | Requests/s | Latency | Throughput/Mb ------------------------- | ------- | :----: | ---------: | ------: | ------------: -bare | 8.11.2 | ✗ | 28411.2 | 3.44 | 4.04 -connect-router | 1.3.2 | ✓ | 30328 | 3.22 | 4.36 -connect | 3.6.6 | ✗ | 32076.8 | 3.04 | 4.53 -express-route-prefix | 4.16.2 | ✓ | 14447.2 | 6.81 | 4.97 -express-with-middlewares | 4.16.2 | ✓ | 14988 | 6.53 | 5.42 -express | 4.16.2 | ✓ | 20776 | 4.7 | 3.24 -fastify-big-json | 1.5.0 | ✓ | 5002.8 | 19.43 | 57.40 -**fastify** | **1.5.0** | ✓ | **33924.81** | **2.87** | **5.33** -hapi | 17.5.0 | ✓ | 20116.8 | 4.88 | 3.11 -koa-router | 7.4.0 | ✓ | 22059.2 | 4.44 | 3.44 -koa | 2.5.0 | ✗ | 25364.8 | 3.86 | 3.99 -micro | 9.1.0 | ✗ | 31902.4 | 3.06 | 4.97 -microrouter | 3.1.1 | ✓ | 17989.6 | 5.44 | 2.84 -polka | 0.4.0 | ✓ | 34177.6 | 2.85 | 3.79 -rayo | 0.5.8 | ✓ | 34238.4 | 2.85 | 3.84 -restify | 7.1.0 | ✓ | 23956.8 | 3.89 | 3.84 -spirit-router | 0.5.0 | ✓ | 29272 | 3.16 | 4.58 -spirit | 0.6.1 | ✗ | 30785.6 | 3.01 | 4.83 -take-five | 1.3.4 | ✓ | 24491.2 | 3.7 | 8.07 -total.js | 2.9.4 | ✓ | 21019.2 | 4.65 | 6.03 -trek-engine | 1.0.5 | ✗ | 28718.4 | 3.4 | 4.06 -trek-router | 1.2.0 | ✓ | 28513.6 | 3.43 | 3.99 +``` +┌──────────────────────────┬─────────┬────────┬────────────┬─────────┬───────────────┐ +│ │ Version │ Router │ Requests/s │ Latency │ Throughput/Mb │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ bare │ 8.11.2 │ ✗ │ 30156.8 │ 3.23 │ 4.36 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ connect-router │ 1.3.2 │ ✓ │ 32603.8 │ 2.98 │ 4.62 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ connect │ 3.6.6 │ ✗ │ 38119.2 │ 2.54 │ 5.37 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ express-route-prefix │ 4.16.2 │ ✓ │ 18524.95 │ 5.45 │ 6.46 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ express-with-middlewares │ 4.16.2 │ ✓ │ 14403.4 │ 6.83 │ 5.21 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ express │ 4.16.2 │ ✓ │ 22365.2 │ 4.38 │ 3.50 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ fastify-big-json │ 1.5.0 │ ✓ │ 5273.8 │ 18.83 │ 60.60 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ fastify │ 1.5.0 │ ✓ │ 35912 │ 2.7 │ 5.62 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ hapi │ 17.5.0 │ ✓ │ 21769.2 │ 4.53 │ 3.42 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ koa-router │ 7.4.0 │ ✓ │ 23903.6 │ 4.1 │ 3.74 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ koa │ 2.5.0 │ ✗ │ 24987.2 │ 3.92 │ 3.89 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ micro │ 9.1.0 │ ✗ │ 35254.4 │ 2.75 │ 5.54 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ microrouter │ 3.1.1 │ ✓ │ 19473.6 │ 5.04 │ 3.03 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ polka │ 0.4.0 │ ✓ │ 36824 │ 2.63 │ 5.23 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ rayo │ 1.0.0 │ ✓ │ 35299.2 │ 2.74 │ 5.06 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ restify │ 7.1.0 │ ✓ │ 20796 │ 4.38 │ 3.30 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ spirit-router │ 0.5.0 │ ✓ │ 27592.4 │ 3.2 │ 4.34 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ spirit │ 0.6.1 │ ✗ │ 36883.2 │ 2.39 │ 5.78 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ take-five │ 1.3.5 │ ✓ │ 29164.8 │ 3.04 │ 9.74 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ total.js │ 2.9.30 │ ✓ │ 22850.8 │ 4.29 │ 6.51 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ trek-engine │ 1.0.5 │ ✗ │ 31837.2 │ 3.06 │ 4.58 │ +├──────────────────────────┼─────────┼────────┼────────────┼─────────┼───────────────┤ +│ trek-router │ 1.2.0 │ ✓ │ 28472.8 │ 3.43 │ 4.11 │ +└──────────────────────────┴─────────┴────────┴────────────┴─────────┴───────────────┘ +``` diff --git a/benchmarks/bare.js b/benchmarks/bare.js index 90ef1e1d..1cce1a4a 100644 --- a/benchmarks/bare.js +++ b/benchmarks/bare.js @@ -1,7 +1,7 @@ 'use strict' const server = require('http').createServer(function (req, res) { - res.setHeader('Content-Type', 'application/json') + res.setHeader('content-type', 'application/json') res.end(JSON.stringify({ hello: 'world' })) }) diff --git a/benchmarks/polka.js b/benchmarks/polka.js index 24bdb551..9924791c 100644 --- a/benchmarks/polka.js +++ b/benchmarks/polka.js @@ -5,6 +5,7 @@ const polka = require('polka') const app = polka() app.get('/', (req, res) => { + res.setHeader('content-type', 'application/json') res.end(JSON.stringify({ hello: 'world' })) }) diff --git a/package.json b/package.json index ba63599b..d139f8b1 100644 --- a/package.json +++ b/package.json @@ -17,35 +17,35 @@ "license": "MIT", "dependencies": { "@leizm/web": "^1.7.1", - "autocannon": "^2.0.0", + "autocannon": "^2.4.1", "autocannon-compare": "^0.3.0", - "chalk": "^2.3.2", + "chalk": "^2.4.1", "cli-table": "^0.3.1", - "commander": "^2.14.1", + "commander": "^2.15.1", "connect": "^3.6.6", "cors": "^2.8.4", "dns-prefetch-control": "^0.1.0", - "express": "^4.16.2", - "fastify": "^1.5.0", + "express": "^4.16.3", + "fastify": "^1.6.0", "frameguard": "^3.0.0", - "hapi": "^17.5.0", + "hapi": "^17.5.1", "hide-powered-by": "^1.0.0", "hsts": "^2.1.0", "ienoopen": "^1.0.0", - "inquirer": "^5.2.0", - "koa": "^2.5.0", + "inquirer": "^6.0.0", + "koa": "^2.5.1", "koa-router": "^7.4.0", "make-promises-safe": "^1.1.0", - "micro": "^9.1.0", - "microrouter": "^3.1.1", + "micro": "^9.3.2", + "microrouter": "^3.1.3", "ora": "^2.1.0", "polka": "^0.4.0", - "rayo": "^0.5.8", - "restify": "^7.1.0", + "rayo": "^1.0.4", + "restify": "^7.2.1", "router": "^1.3.2", "spirit": "^0.6.1", "spirit-router": "^0.5.0", - "take-five": "^1.3.4", + "take-five": "^1.4.0", "total.js": "^2.9.4", "trek-engine": "^1.0.5", "trek-router": "^1.2.0", @@ -53,6 +53,6 @@ }, "devDependencies": { "snazzy": "^7.1.1", - "standard": "^11.0.0" + "standard": "^11.0.1" } }