Skip to content

Commit

Permalink
ci: upgrade yarn to v4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Feb 8, 2024
1 parent ff16b4c commit 04cd382
Show file tree
Hide file tree
Showing 105 changed files with 54,249 additions and 37,880 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:

- name: Install dependencies
run: |
yarn install --frozen-lockfile --network-timeout 500000
yarn install --network-timeout 500000
cd benchmarks
yarn install --frozen-lockfile --network-timeout 500000
yarn install --network-timeout 500000
- name: run benchmarks
run: yarn benchmarks
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
run: yarn install --immutable --network-timeout 500000
- name: Run lint
run: yarn test:lint

Expand All @@ -37,16 +37,16 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [16.x, 18.x]
node-version: [18.x, 20.x]
exclude:
- os: macos-latest
node-version: 20.x
- os: macos-latest
node-version: 16.x
node-version: 18.x
- os: windows-latest
node-version: 20.x
- os: windows-latest
node-version: 16.x
node-version: 18.x

steps:
- uses: actions/checkout@v3
Expand All @@ -57,7 +57,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
run: yarn install --immutable --network-timeout 500000
- name: Run build
run: yarn tsc --build
env:
Expand All @@ -83,7 +83,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
run: yarn install --immutable --network-timeout 500000
- name: Run build
run: yarn tsc --build
- name: Run test
Expand All @@ -105,7 +105,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
run: yarn install --immutable --network-timeout 500000
- name: Run build
run: yarn tsc --build
- name: Run test
Expand All @@ -127,7 +127,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
run: yarn install --immutable --network-timeout 500000
- name: Run build
run: yarn tsc --build
- name: Run test
Expand All @@ -149,7 +149,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
run: yarn install --immutable --network-timeout 500000
- name: Run build
run: yarn tsc --build
- name: Run test
Expand All @@ -171,7 +171,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
run: yarn install --immutable --network-timeout 500000
- name: Run build
run: yarn tsc --build
- name: Run test
Expand All @@ -193,7 +193,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
run: yarn install --immutable --network-timeout 500000
- name: Run build
run: yarn tsc --build
- name: Run test
Expand All @@ -215,7 +215,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
run: yarn install --immutable --network-timeout 500000
- name: Run build
run: yarn tsc --build
- name: Run test
Expand All @@ -237,7 +237,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
run: yarn install --immutable --network-timeout 500000
- name: Run build
run: yarn tsc --build
- name: Run test
Expand Down Expand Up @@ -265,7 +265,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-engines --network-timeout 500000
run: yarn install --immutable --network-timeout 500000
- name: Release packages
env:
CI: true
Expand All @@ -290,7 +290,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-engines --network-timeout 500000
run: yarn install --immutable --network-timeout 500000
- name: Build pages
env:
CI: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000
run: yarn install --immutable --network-timeout 500000
- name: Build pages
env:
CI: true
Expand All @@ -42,7 +42,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000
run: yarn install --immutable --network-timeout 500000
- name: Build pages
env:
CI: true
Expand Down
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,14 @@ tools/**/dist
/docs-references/api
/docs-references/tutorials
/docs-references/package.json


# Yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/cache
!.yarn/sdks
!.yarn/versions
893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.1.0.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules
compressionLevel: mixed
yarnPath: .yarn/releases/yarn-4.1.0.cjs
10 changes: 10 additions & 0 deletions benchmarks/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
results

# Yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/cache
!.yarn/sdks
!.yarn/versions
46 changes: 25 additions & 21 deletions benchmarks/ISSUE_COMMENT.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
# Benchmarks

- **Machine:** darwin arm64 | 8 vCPUs | 32.0GB Mem
- **Node:** `v16.13.1`
- **Run:** Sat Aug 13 2022 18:59:16 GMT+0200 (Central European Summer Time)
- **Method:** `autocannon -c 100 -d 40 -p 10 localhost:3000` (two rounds; one to warm-up, one to measure)
- **Node:** `v18.19.0`
- **Run:** Mon Feb 05 2024 07:39:14 GMT+0100 (Central European Standard Time)
- **Method:** `autocannon -c 100 -d 10 -p 10 localhost:3000` (two rounds; one to warm-up, one to measure)

| | Version | Router | Requests/s | Latency | Throughput/Mb |
| :-------------------------- | ------: | -----: | :--------: | ------: | ------------: |
| fastify | 3.29.1 || 115654.4 | 8.15 | 20.62 |
| fastify-injector | 3.29.1 || 73362.9 | 13.13 | 16.72 |
| express | 4.18.1 || 25898.0 | 38.04 | 4.62 |
| express-route-prefix | 4.18.1 || 25680.5 | 38.43 | 9.50 |
| express-with-middlewares | 4.18.1 || 24525.5 | 40.26 | 9.12 |
| express-injector | 4.18.1 || 23012.7 | 42.88 | 5.24 |
| express-injector-http-hook | 4.18.1 || 16211.3 | 61.02 | 3.70 |
| express-injector-async-hook | 4.18.1 || 15442.4 | 64.06 | 3.52 |
| tsed-express | 6.126.1 || 14232.5 | 69.56 | 2.61 |
| fastify-big-json | 3.29.1 || N/A | N/A | N/A |
| koa-isomorphic-router | 1.0.1 || N/A | N/A | N/A |
| koa-router | 10.1.1 || N/A | N/A | N/A |
| koa | 2.13.4 || N/A | N/A | N/A |
| nest-fastify | 8.4.3 || N/A | N/A | N/A |
| nest | 8.4.3 || N/A | N/A | N/A |
| tsed-koa | 6.126.1 || N/A | N/A | N/A |
| | Version | Router | Requests/s | Latency | Throughput/Mb |
| :--------------- | ------: | -----: | :--------: | ------: | ------------: |
| fastify | 3.29.4 || 71505.5 | 13.48 | 12.75 |
| koa | 2.13.4 || 60188.0 | 17.46 | 10.73 |
| nest-fastify | 8.4.3 || 55904.9 | 20.59 | 9.97 |
| fastify-injector | 3.29.4 || 55235.2 | 17.60 | 12.59 |
| express-injector | 4.18.1 || 18922.9 | 52.23 | 4.31 |
| express | 4.18.1 || 17795.2 | 55.56 | 3.17 |
| nest | 8.4.3 || 17642.8 | 71.10 | 4.24 |
| fastify-big-json | 3.29.4 || 15840.7 | 62.44 | 182.26 |
| express-morgan | 4.18.1 || 13839.4 | 77.28 | 2.47 |
| tsed-express | 7.61.0 || N/A | N/A | N/A |
| tsed-koa | 7.61.0 || N/A | N/A | N/A |

## Explanation

The benchmark shows a performance difference between the frameworks. We note that Ts.ED is often last. In fact, Ts.ED uses features useful to a production application which reduce its performance.

For example, Ts.ED initializes a sandbox (async_hook) for each request in order to work in an isolated context if necessary.
It also initializes the elements necessary for monitoring requests in a log manager.

All this at a necessary cost that reflects the reality of a production application ;)
48 changes: 26 additions & 22 deletions benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,29 @@
# Benchmarks

- **Machine:** darwin arm64 | 8 vCPUs | 32.0GB Mem
- **Node:** `v16.13.1`
- **Run:** Sat Aug 13 2022 18:59:16 GMT+0200 (Central European Summer 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 | Throughput/Mb |
| :-------------------------- | ------: | -----: | :--------: | ------: | ------------: |
| fastify | 3.29.1 || 115654.4 | 8.15 | 20.62 |
| fastify-injector | 3.29.1 || 73362.9 | 13.13 | 16.72 |
| express | 4.18.1 || 25898.0 | 38.04 | 4.62 |
| express-route-prefix | 4.18.1 || 25680.5 | 38.43 | 9.50 |
| express-with-middlewares | 4.18.1 || 24525.5 | 40.26 | 9.12 |
| express-injector | 4.18.1 || 23012.7 | 42.88 | 5.24 |
| express-injector-http-hook | 4.18.1 || 16211.3 | 61.02 | 3.70 |
| express-injector-async-hook | 4.18.1 || 15442.4 | 64.06 | 3.52 |
| tsed-express | 6.126.1 || 14232.5 | 69.56 | 2.61 |
| fastify-big-json | 3.29.1 || N/A | N/A | N/A |
| koa-isomorphic-router | 1.0.1 || N/A | N/A | N/A |
| koa-router | 10.1.1 || N/A | N/A | N/A |
| koa | 2.13.4 || N/A | N/A | N/A |
| nest-fastify | 8.4.3 || N/A | N/A | N/A |
| nest | 8.4.3 || N/A | N/A | N/A |
| tsed-koa | 6.126.1 || N/A | N/A | N/A |
- **Node:** `v18.19.0`
- **Run:** Mon Feb 05 2024 07:39:14 GMT+0100 (Central European Standard Time)
- **Method:** `autocannon -c 100 -d 10 -p 10 localhost:3000` (two rounds; one to warm-up, one to measure)

| | Version | Router | Requests/s | Latency | Throughput/Mb |
| :--------------- | ------: | -----: | :--------: | ------: | ------------: |
| fastify | 3.29.4 || 71505.5 | 13.48 | 12.75 |
| koa | 2.13.4 || 60188.0 | 17.46 | 10.73 |
| nest-fastify | 8.4.3 || 55904.9 | 20.59 | 9.97 |
| fastify-injector | 3.29.4 || 55235.2 | 17.60 | 12.59 |
| express-injector | 4.18.1 || 18922.9 | 52.23 | 4.31 |
| express | 4.18.1 || 17795.2 | 55.56 | 3.17 |
| nest | 8.4.3 || 17642.8 | 71.10 | 4.24 |
| fastify-big-json | 3.29.4 || 15840.7 | 62.44 | 182.26 |
| express-morgan | 4.18.1 || 13839.4 | 77.28 | 2.47 |
| tsed-express | 7.61.0 || N/A | N/A | N/A |
| tsed-koa | 7.61.0 || N/A | N/A | N/A |

## Explanation

The benchmark shows a performance difference between the frameworks. We note that Ts.ED is often last. In fact, Ts.ED uses features useful to a production application which reduce its performance.

For example, Ts.ED initializes a sandbox (async_hook) for each request in order to work in an isolated context if necessary.
It also initializes the elements necessary for monitoring requests in a log manager.

All this at a necessary cost that reflects the reality of a production application ;)
34 changes: 11 additions & 23 deletions benchmarks/benchmark-results.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
[
{"name": "fastify", "version": "3.29.1", "hasRouter": true, "requests": "115654.4", "latency": "8.15", "throughput": "20.62"},
{"name": "fastify-injector", "version": "3.29.1", "hasRouter": true, "requests": "73362.9", "latency": "13.13", "throughput": "16.72"},
{"name": "express", "version": "4.18.1", "hasRouter": true, "requests": "25898.0", "latency": "38.04", "throughput": "4.62"},
{"name": "express-route-prefix", "version": "4.18.1", "hasRouter": true, "requests": "25680.5", "latency": "38.43", "throughput": "9.50"},
{
"name": "express-with-middlewares",
"version": "4.18.1",
"hasRouter": true,
"requests": "24525.5",
"latency": "40.26",
"throughput": "9.12"
},
{"name": "express-injector", "version": "4.18.1", "requests": "23012.7", "latency": "42.88", "throughput": "5.24"},
{"name": "express-injector-http-hook", "version": "4.18.1", "requests": "16211.3", "latency": "61.02", "throughput": "3.70"},
{"name": "express-injector-async-hook", "version": "4.18.1", "requests": "15442.4", "latency": "64.06", "throughput": "3.52"},
{"name": "tsed-express", "version": "6.126.1", "hasRouter": true, "requests": "14232.5", "latency": "69.56", "throughput": "2.61"},
{"name": "fastify-big-json", "version": "3.29.1", "hasRouter": true, "requests": "N/A", "latency": "N/A", "throughput": "N/A"},
{"name": "koa-isomorphic-router", "version": "1.0.1", "hasRouter": true, "requests": "N/A", "latency": "N/A", "throughput": "N/A"},
{"name": "koa-router", "version": "10.1.1", "hasRouter": true, "requests": "N/A", "latency": "N/A", "throughput": "N/A"},
{"name": "koa", "version": "2.13.4", "requests": "N/A", "latency": "N/A", "throughput": "N/A"},
{"name": "nest-fastify", "version": "8.4.3", "hasRouter": true, "requests": "N/A", "latency": "N/A", "throughput": "N/A"},
{"name": "nest", "version": "8.4.3", "hasRouter": true, "requests": "N/A", "latency": "N/A", "throughput": "N/A"},
{"name": "tsed-koa", "version": "6.126.1", "hasRouter": true, "requests": "N/A", "latency": "N/A", "throughput": "N/A"}
{"name": "fastify", "version": "3.29.4", "hasRouter": true, "requests": "71505.5", "latency": "13.48", "throughput": "12.75"},
{"name": "koa", "version": "2.13.4", "requests": "60188.0", "latency": "17.46", "throughput": "10.73"},
{"name": "nest-fastify", "version": "8.4.3", "hasRouter": true, "requests": "55904.9", "latency": "20.59", "throughput": "9.97"},
{"name": "fastify-injector", "version": "3.29.4", "hasRouter": true, "requests": "55235.2", "latency": "17.60", "throughput": "12.59"},
{"name": "express-injector", "version": "4.18.1", "requests": "18922.9", "latency": "52.23", "throughput": "4.31"},
{"name": "express", "version": "4.18.1", "hasRouter": true, "requests": "17795.2", "latency": "55.56", "throughput": "3.17"},
{"name": "nest", "version": "8.4.3", "hasRouter": true, "requests": "17642.8", "latency": "71.10", "throughput": "4.24"},
{"name": "fastify-big-json", "version": "3.29.4", "hasRouter": true, "requests": "15840.7", "latency": "62.44", "throughput": "182.26"},
{"name": "express-morgan", "version": "4.18.1", "requests": "13839.4", "latency": "77.28", "throughput": "2.47"},
{"name": "tsed-express", "version": "7.61.0", "hasRouter": true, "requests": "N/A", "latency": "N/A", "throughput": "N/A"},
{"name": "tsed-koa", "version": "7.61.0", "hasRouter": true, "requests": "N/A", "latency": "N/A", "throughput": "N/A"}
]
21 changes: 10 additions & 11 deletions benchmarks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,21 @@
"license": "MIT",
"dependencies": {
"@hapi/hapi": "^20.0.1",
"morgan": "1.10.0",
"clinic": "^11.1.2",
"execa": "^6.1.0",
"@nestjs/common": "8.4.3",
"@nestjs/core": "9.0.5",
"@nestjs/platform-express": "8.4.3",
"@nestjs/platform-fastify": "8.4.3",
"autocannon": "^7.0.1",
"autocannon-compare": "^0.4.0",
"benchmark": "^2.1.4",
"chalk": "^4.1.2",
"cli-table": "^0.3.1",
"clinic": "^11.1.2",
"commander": "^9.0.0",
"connect": "^3.6.6",
"cors": "^2.8.5",
"dns-prefetch-control": "^0.3.0",
"execa": "^6.1.0",
"express": "^4.16.4",
"fastify": "^3.29.4",
"frameguard": "^4.0.0",
Expand All @@ -47,14 +50,10 @@
"micro": "^9.3.3",
"micro-route": "^2.5.0",
"microrouter": "^3.1.3",
"morgan": "1.10.0",
"restify": "^8.0.0",
"rimraf": "^5.0.5",
"router": "^1.3.3",
"x-xss-protection": "^2.0.0",
"@nestjs/common": "8.4.3",
"@nestjs/core": "9.0.5",
"@nestjs/platform-express": "8.4.3",
"@nestjs/platform-fastify": "8.4.3"
},
"devDependencies": {},
"peerDependencies": {}
"x-xss-protection": "^2.0.0"
}
}
Loading

0 comments on commit 04cd382

Please sign in to comment.