-
Notifications
You must be signed in to change notification settings - Fork 24
215 lines (206 loc) · 6.62 KB
/
benchmark.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
name: Benchmark
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
K6_VERSION: v0.44.1
PORT: 50000
jobs:
http:
name: http
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
- name: Install
run: yarn install --immutable
- name: Download k6
run: |
curl https://github.com/grafana/k6/releases/download/${{ env.K6_VERSION }}/k6-${{ env.K6_VERSION }}-linux-amd64.tar.gz -L | tar xvz --strip-components 1
- name: Run
run: yarn tsx benchmark/servers/http.ts &
- name: Benchmark
run: ./k6 run benchmark/k6.mjs --summary-export summary.json
- name: Summary
run: |
echo '```json' >> $GITHUB_STEP_SUMMARY
cat summary.json >> $GITHUB_STEP_SUMMARY
echo -e '\n```' >> $GITHUB_STEP_SUMMARY
express:
name: express
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
- name: Install
run: yarn install --immutable
- name: Download k6
run: |
curl https://github.com/grafana/k6/releases/download/${{ env.K6_VERSION }}/k6-${{ env.K6_VERSION }}-linux-amd64.tar.gz -L | tar xvz --strip-components 1
- name: Run
run: yarn tsx benchmark/servers/express.ts &
- name: Benchmark
run: ./k6 run benchmark/k6.mjs --summary-export summary.json
- name: Summary
run: |
echo '```json' >> $GITHUB_STEP_SUMMARY
cat summary.json >> $GITHUB_STEP_SUMMARY
echo -e '\n```' >> $GITHUB_STEP_SUMMARY
fastify:
name: fastify
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
- name: Install
run: yarn install --immutable
- name: Download k6
run: |
curl https://github.com/grafana/k6/releases/download/${{ env.K6_VERSION }}/k6-${{ env.K6_VERSION }}-linux-amd64.tar.gz -L | tar xvz --strip-components 1
- name: Run
run: yarn tsx benchmark/servers/fastify.ts &
- name: Benchmark
run: ./k6 run benchmark/k6.mjs --summary-export summary.json
- name: Summary
run: |
echo '```json' >> $GITHUB_STEP_SUMMARY
cat summary.json >> $GITHUB_STEP_SUMMARY
echo -e '\n```' >> $GITHUB_STEP_SUMMARY
koa:
name: koa
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
- name: Install
run: yarn install --immutable
- name: Download k6
run: |
curl https://github.com/grafana/k6/releases/download/${{ env.K6_VERSION }}/k6-${{ env.K6_VERSION }}-linux-amd64.tar.gz -L | tar xvz --strip-components 1
- name: Run
run: yarn tsx benchmark/servers/koa.ts &
- name: Benchmark
run: ./k6 run benchmark/k6.mjs --summary-export summary.json
- name: Summary
run: |
echo '```json' >> $GITHUB_STEP_SUMMARY
cat summary.json >> $GITHUB_STEP_SUMMARY
echo -e '\n```' >> $GITHUB_STEP_SUMMARY
uWebSockets:
name: uWebSockets
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
- name: Install
run: yarn install --immutable
- name: Download k6
run: |
curl https://github.com/grafana/k6/releases/download/${{ env.K6_VERSION }}/k6-${{ env.K6_VERSION }}-linux-amd64.tar.gz -L | tar xvz --strip-components 1
- name: Run
run: yarn tsx benchmark/servers/uWebSockets.ts &
- name: Benchmark
run: ./k6 run benchmark/k6.mjs --summary-export summary.json
- name: Summary
run: |
echo '```json' >> $GITHUB_STEP_SUMMARY
cat summary.json >> $GITHUB_STEP_SUMMARY
echo -e '\n```' >> $GITHUB_STEP_SUMMARY
deno:
name: deno
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
- name: Set up deno
uses: denoland/setup-deno@v1
with:
deno-version: 1.x
- name: Set up deno cache
uses: actions/cache@v3
with:
path: |
~/.deno
~/.cache/deno
key: ${{ runner.os }}-deno-${{ hashFiles('**/yarn.lock') }}
- name: Install
run: yarn install --immutable
- name: Download k6
run: |
curl https://github.com/grafana/k6/releases/download/${{ env.K6_VERSION }}/k6-${{ env.K6_VERSION }}-linux-amd64.tar.gz -L | tar xvz --strip-components 1
- name: Build
run: yarn run build:esm
- name: Cache
run: deno cache benchmark/servers/deno.ts
- name: Run
run: deno run -A benchmark/servers/deno.ts &
- name: Benchmark
run: ./k6 run benchmark/k6.mjs --summary-export summary.json
- name: Summary
run: |
echo '```json' >> $GITHUB_STEP_SUMMARY
cat summary.json >> $GITHUB_STEP_SUMMARY
echo -e '\n```' >> $GITHUB_STEP_SUMMARY
bun:
name: bun
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
- name: Set up bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install
run: yarn install --immutable
- name: Download k6
run: |
curl https://github.com/grafana/k6/releases/download/${{ env.K6_VERSION }}/k6-${{ env.K6_VERSION }}-linux-amd64.tar.gz -L | tar xvz --strip-components 1
- name: Run
run: bun run benchmark/servers/bun.ts &
- name: Benchmark
run: ./k6 run benchmark/k6.mjs --summary-export summary.json
- name: Summary
run: |
echo '```json' >> $GITHUB_STEP_SUMMARY
cat summary.json >> $GITHUB_STEP_SUMMARY
echo -e '\n```' >> $GITHUB_STEP_SUMMARY