Skip to content

Commit cce970a

Browse files
committed
chore: gc
1 parent a86cb8e commit cce970a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
with:
4747
path: ${{ env.RSPACK_DIR }}
4848
- name: Run benchmark
49-
run: node bin/cli.js bench --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
49+
run: node --expose-gc bin/cli.js bench --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
5050
- id: print-compare-results
5151
name: Print compare results
5252
run: |

lib/scenarios/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ module.exports.plugins.push(new (require("../../lib/scenarios/build-plugin.cjs")
134134
for (let i = 0; i < ctx.runTimes; i++) {
135135
await clearCaches(ctx.caseDir);
136136

137+
if (global.gc) {
138+
global.gc();
139+
} else {
140+
console.log('Garbage collection is not exposed.');
141+
}
142+
137143
ctx.runData.push(await runRspack(ctx));
138144

139145
const runtime = Date.now() - start;

0 commit comments

Comments
 (0)