Skip to content

Commit 4f04278

Browse files
author
Taras Mankovski
committed
🔬 diag: isolate effect.events under CodSpeed at depths 2/10/50/100
1 parent 8f6f38f commit 4f04278

2 files changed

Lines changed: 72 additions & 0 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CodSpeed Diag
2+
3+
on:
4+
push:
5+
branches: [codspeed-diag]
6+
7+
permissions:
8+
contents: read
9+
id-token: write
10+
11+
jobs:
12+
diag:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 12
15+
steps:
16+
- name: checkout
17+
uses: actions/checkout@v4
18+
19+
- name: setup deno
20+
uses: denoland/setup-deno@v2
21+
with:
22+
deno-version: v2.x
23+
24+
- name: setup node
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: "22"
28+
29+
- name: build effection npm package
30+
run: |
31+
deno task build:npm 0.0.0-bench
32+
cd build/npm
33+
npm pack
34+
mv *.tgz ../../effection.tgz
35+
36+
- name: install bench-node deps
37+
working-directory: bench-node
38+
run: |
39+
npm install ../effection.tgz --legacy-peer-deps
40+
npm install --legacy-peer-deps
41+
42+
- name: run effect.events diagnostic under CodSpeed
43+
uses: CodSpeedHQ/action@v4
44+
with:
45+
mode: simulation
46+
run: node --experimental-strip-types bench-node/diag.bench.ts

‎bench-node/diag.bench.ts‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* DIAGNOSTIC (throwaway): isolate effect.events under CodSpeed instrumentation
3+
* at several depths to tell hang-vs-slow apart.
4+
*
5+
* Watch the runner's "Measured … effect.events@N" markers:
6+
* - all complete quickly -> size/slowness (a smaller depth rescues it)
7+
* - @2 itself never prints -> fundamental hang under Valgrind (drop it)
8+
*
9+
* Run: node --experimental-strip-types bench-node/diag.bench.ts
10+
*/
11+
12+
import { Bench } from "tinybench";
13+
import { withCodSpeed } from "@codspeed/tinybench-plugin";
14+
import { run } from "effection";
15+
import { effectEvents } from "./scenarios/effect.events.ts";
16+
17+
const bench = withCodSpeed(new Bench());
18+
19+
for (const depth of [2, 10, 50, 100]) {
20+
bench.add(`effect.events@${depth}`, async () => {
21+
await run(() => effectEvents.run(depth));
22+
});
23+
}
24+
25+
await bench.run();
26+
console.table(bench.table());

0 commit comments

Comments
 (0)