Skip to content

Commit

Permalink
Write bold results for fastify (when using compare -t). Updated rea…
Browse files Browse the repository at this point in the history
…dme benchmarks. Updated modules.
  • Loading branch information
aichholzer committed May 22, 2018
1 parent 0fafbb0 commit 0849aa6
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 16 deletions.
34 changes: 28 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,31 @@ benchmark [arguments (optional)]
# Benchmarks

__Machine:__ MacBook Pro (Retina, 13-inch, Early 2015) **Processor**: 2,7 GHz Intel Core i5 **Memory**: 8 GB 1867 MHz DDR3

__Method:__ `autocannon -c 10 -d 2 -p 1 localhost:3000` * 2, taking the second average


[![asciicast](https://asciinema.org/a/SA9z6g2HjOr0n80KwEvUaWoSS.png)](https://asciinema.org/a/SA9z6g2HjOr0n80KwEvUaWoSS)
* __Machine:__ MacBook Pro (Late 2013 | 2.3 GHz Intel Core i7 | 16 GB 1600 MHz DDR3)
* __Method:__ `autocannon -c 100 -d 5 -p 10 localhost:3000` (two rounds; one warm-up, one to measure).
* __Node:__ `10.1.0`

  | Router | Requests/s | Latency | Throughput/Mb
------------------------ | :------: | ---------: | ------: | ------------:
bare | ✗ | 38198.4 | 2.54 | 5.38
connect | ✗ | 38755.2 | 2.51 | 5.47
connect-router | ✓ | 33953.6 | 2.87 | 4.78
express | ✓ | 26680 | 3.66 | 4.26
express-route-prefix | ✓ | 18804.8 | 5.22 | 6.58
express-with-middlewares | ✓ | 19739.2 | 4.95 | 7.08
**fastify** | ✓ | **37268.81** | **2.55** | **5.95**
fastify-big-json | ✓ | 8931.6 | 10.95 | 102.80
hapi | ✓ | 27182.4 | 3.6 | 4.21
koa | ✗ | 30395.2 | 3.21 | 4.72
koa-router | ✓ | 27819.2 | 3.51 | 4.36
micro | ✗ | 38928 | 2.5 | 6.13
micro-router | ✓ | 23086.4 | 4.23 | 3.59
polka | ✓ | 38340.81 | 2.54 | 4.26
rayo | ✓ | 40291.2 | 2.41 | 4.49
restify | ✓ | 28632 | 3.26 | 4.53
spirit | ✗ | 36969.6 | 2.51 | 5.78
spirit-router | ✓ | 34894.4 | 2.67 | 5.47
take-five | ✓ | 28305.6 | 3.14 | 9.55
total.js | ✓ | 27176 | 3.59 | 7.75
trek-engine | ✗ | 32137.6 | 3.03 | 4.59
trek-engine-router | ✓ | 33908.81 | 2.87 | 4.88
10 changes: 6 additions & 4 deletions benchmark-compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ if (!choices.length) {
head: ['', 'Requests/s', 'Latency', 'Throughput/Mb']
})

const bold = (writeBold, str) => writeBold ? chalk.bold(str) : str
choices.forEach((result) => {
let data = readFileSync(`${resultsPath}/${result}.json`)
data = JSON.parse(data.toString())
const beBold = result === 'fastify'
table.push([
chalk.blue(result),
data.requests.average,
data.latency.average,
(data.throughput.average / 1024 / 1024).toFixed(2)
bold(beBold, chalk.blue(result)),
bold(beBold, data.requests.average),
bold(beBold, data.latency.average),
bold(beBold, (data.throughput.average / 1024 / 1024).toFixed(2))
])
})

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@
"cors": "^2.8.4",
"dns-prefetch-control": "^0.1.0",
"express": "^4.16.2",
"fastify": "^1.0.0-rc.3",
"fastify": "^1.5.0",
"frameguard": "^3.0.0",
"hapi": "^17.2.1",
"hapi": "^17.5.0",
"hide-powered-by": "^1.0.0",
"hsts": "^2.1.0",
"ienoopen": "^1.0.0",
"inquirer": "^3.3.0",
"inquirer": "^5.2.0",
"koa": "^2.5.0",
"koa-router": "^7.4.0",
"make-promises-safe": "^1.1.0",
"micro": "^9.1.0",
"microrouter": "^3.1.1",
"ora": "^1.4.0",
"polka": "^0.3.4",
"rayo": "^0.5.1",
"ora": "^2.1.0",
"polka": "^0.4.0",
"rayo": "^0.5.8",
"restify": "^7.1.0",
"router": "^1.3.2",
"spirit": "^0.6.1",
Expand Down

0 comments on commit 0849aa6

Please sign in to comment.