Skip to content

Commit 73e264a

Browse files
committed
fix(ci): run throughput bench in its own walltime job
CodSpeed walltime mode finalizes result collection once per process, so a second withCodSpeed bench.run() in the same process has no latency to collect and crashes (TypeError destructuring result.latency). walltime.ts combined startup + throughput in one process; split throughput into its own job so each walltime process runs a single bench.
1 parent f5fee1c commit 73e264a

2 files changed

Lines changed: 46 additions & 4 deletions

File tree

.github/workflows/benchmark.yml

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,52 @@ jobs:
136136
if: steps.deno-cache.outputs.cache-hit != 'true'
137137
run: deno install
138138

139-
- name: Run walltime benchmarks
139+
- name: Run startup benchmarks
140140
uses: CodSpeedHQ/action@9d332c4d90b43981c3e55ae8e38e68709996240f # v4.17.0
141141
with:
142142
mode: walltime
143-
run: node bench/walltime.ts
143+
run: node bench/startup.bench.ts
144+
145+
throughput:
146+
name: Run benchmarks (throughput)
147+
needs: build
148+
runs-on: codspeed-macro
149+
permissions:
150+
contents: read # clone repo
151+
id-token: write # upload benchmark results to codspeed
152+
153+
steps:
154+
- name: Checkout
155+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
156+
157+
- name: Setup Deno
158+
uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4
159+
with:
160+
deno-version: v2.x
161+
162+
- name: Setup Node
163+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
164+
with:
165+
node-version: 24
166+
167+
- name: Download build artifact
168+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
169+
with:
170+
name: bench-build
171+
172+
- name: Restore dependencies
173+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
174+
id: deno-cache
175+
with:
176+
path: node_modules
177+
key: deno-codspeed-${{ runner.arch }}-${{ hashFiles('deno.lock') }}
178+
179+
- name: Install dependencies
180+
if: steps.deno-cache.outputs.cache-hit != 'true'
181+
run: deno install
182+
183+
- name: Run throughput benchmark
184+
uses: CodSpeedHQ/action@9d332c4d90b43981c3e55ae8e38e68709996240f # v4.17.0
185+
with:
186+
mode: walltime
187+
run: node bench/throughput.bench.ts

bench/walltime.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)