Skip to content

Commit

Permalink
chore: update version in package.json
Browse files Browse the repository at this point in the history
chore: Update benchmark results template to include additional metadata.
  • Loading branch information
joeyguerra committed Jan 20, 2024
1 parent c56e305 commit 03f5bd1
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 5 deletions.
60 changes: 60 additions & 0 deletions benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,63 @@ Redesigned Express to not create a prototype chain on the req/res objects. The f
| Req/Sec | 52,095 | 52,095 | 65,439 | 65,855 | 62,758.4 | 5,344.96 | 52,088 |
| Bytes/Sec | 12.4 MB | 12.4 MB | 15.6 MB | 15.7 MB | 14.9 MB | 1.27 MB | 12.4 MB |

## 01/20/2024, 02:15:46 PM
Application Version: 4.0.0
Node Version: v18.18.2
Number of Middelware: 1


| Stat | 2.5% | 50% | 97.5% | 99% | Avg | Stdev | Max |
|:-----|:----:|:---:|:-----:|:---:|:---:|:-----:|:---:|
| Latency | 9 ms | 20 ms | 25 ms | 34 ms | 16.86 ms | 6 ms | 68 ms |

| Stat | 1% | 2.5% | 50% | 97.5% | Avg | Stdev | Min |
|:-----|:--:|:----:|:---:|:-----:|:---:|:-----:|:---:|
| Req/Sec | 54,431 | 54,431 | 58,207 | 59,327 | 57,520 | 1,687.71 | 54,403 |
| Bytes/Sec | 13 MB | 13 MB | 13.9 MB | 14.1 MB | 13.7 MB | 403 kB | 12.9 MB |

## 01/20/2024, 02:16:19 PM
Application Version: 4.0.0
Node Version: v19.9.0
Number of Middelware: 1


| Stat | 2.5% | 50% | 97.5% | 99% | Avg | Stdev | Max |
|:-----|:----:|:---:|:-----:|:---:|:---:|:-----:|:---:|
| Latency | 9 ms | 18 ms | 21 ms | 25 ms | 15.43 ms | 5.36 ms | 67 ms |

| Stat | 1% | 2.5% | 50% | 97.5% | Avg | Stdev | Min |
|:-----|:--:|:----:|:---:|:-----:|:---:|:-----:|:---:|
| Req/Sec | 58,303 | 58,303 | 64,127 | 64,799 | 62,793.6 | 2,397.86 | 58,275 |
| Bytes/Sec | 13.9 MB | 13.9 MB | 15.3 MB | 15.4 MB | 14.9 MB | 570 kB | 13.9 MB |

## 01/20/2024, 02:16:34 PM
Application Version: 4.0.0
Node Version: v20.10.0
Number of Middelware: 1


| Stat | 2.5% | 50% | 97.5% | 99% | Avg | Stdev | Max |
|:-----|:----:|:---:|:-----:|:---:|:---:|:-----:|:---:|
| Latency | 7 ms | 18 ms | 20 ms | 25 ms | 15.18 ms | 14.64 ms | 522 ms |

| Stat | 1% | 2.5% | 50% | 97.5% | Avg | Stdev | Min |
|:-----|:--:|:----:|:---:|:-----:|:---:|:-----:|:---:|
| Req/Sec | 61,183 | 61,183 | 64,351 | 65,983 | 63,635.2 | 1,807.61 | 61,165 |
| Bytes/Sec | 14.6 MB | 14.6 MB | 15.3 MB | 15.7 MB | 15.1 MB | 429 kB | 14.6 MB |

## 01/20/2024, 02:17:00 PM
Application Version: 4.0.0
Node Version: v21.5.0
Number of Middelware: 1


| Stat | 2.5% | 50% | 97.5% | 99% | Avg | Stdev | Max |
|:-----|:----:|:---:|:-----:|:---:|:---:|:-----:|:---:|
| Latency | 8 ms | 17 ms | 19 ms | 21 ms | 14.27 ms | 16.27 ms | 590 ms |

| Stat | 1% | 2.5% | 50% | 97.5% | Avg | Stdev | Min |
|:-----|:--:|:----:|:---:|:-----:|:---:|:-----:|:---:|
| Req/Sec | 58,751 | 58,751 | 69,951 | 70,911 | 67,593.61 | 4,583.76 | 58,720 |
| Bytes/Sec | 14 MB | 14 MB | 16.6 MB | 16.9 MB | 16.1 MB | 1.09 MB | 14 MB |

15 changes: 13 additions & 2 deletions benchmarks/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import express from '../index.js'
import autocannon from 'autocannon'
import prettyBytes from 'pretty-bytes'
import fs from 'node:fs'
import pkg from '../package.json' assert { type: 'json'}

const toMs = (ns) => {
return `${Math.floor(ns * 100) / 100} ms`;
Expand Down Expand Up @@ -98,6 +99,7 @@ const toHtmlTable = (data) => {
}
const app = express()
let n = parseInt(process.env.MW || '1', 10)
const numberOfMiddleware = n
console.log(' %s middleware', n)
while (n--) {
app.use(function(req, res, next){
Expand All @@ -109,16 +111,25 @@ app.use((req, res) => {
})
const server = app.listen()
const { port } = server.address()
function formatTitle (config, numberOfMiddleware) {
const date = new Date().toLocaleString('en-US', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: true })
return `## ${date}
Application Version: ${config.version}
Node Version: ${process.version}
Number of Middelware: ${numberOfMiddleware}
`

}
autocannon({
url: `http://localhost:${port}/?foo[bar]=baz`,
pipelining: 10,
connections: 100,
duration: 5,
title: 'Version 3',
title: formatTitle(pkg, numberOfMiddleware),
workers: 4
}, (err, result) => {
console.log(toTable(result))
fs.appendFile(`benchmarks/README.md`, `## ${result.title} - ${new Date().toLocaleString()}
fs.appendFile(`benchmarks/README.md`, `${result.title}
${toTable(result)}\n`, 'utf8', () => {
server.close()
})
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hubot-friends/express",
"description": "Fast, unopinionated, minimalist web framework",
"version": "0.0.0-development",
"version": "4.0.0",
"author": "TJ Holowaychuk <[email protected]>",
"contributors": [
"Aaron Heckmann <[email protected]>",
Expand Down

0 comments on commit 03f5bd1

Please sign in to comment.