Skip to content

Commit

Permalink
chore: gc
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind committed May 31, 2024
1 parent a86cb8e commit cce970a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
with:
path: ${{ env.RSPACK_DIR }}
- name: Run benchmark
run: node bin/cli.js bench --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
run: node --expose-gc bin/cli.js bench --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
- id: print-compare-results
name: Print compare results
run: |
Expand Down
6 changes: 6 additions & 0 deletions lib/scenarios/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ module.exports.plugins.push(new (require("../../lib/scenarios/build-plugin.cjs")
for (let i = 0; i < ctx.runTimes; i++) {
await clearCaches(ctx.caseDir);

if (global.gc) {
global.gc();
} else {
console.log('Garbage collection is not exposed.');
}

ctx.runData.push(await runRspack(ctx));

const runtime = Date.now() - start;
Expand Down

0 comments on commit cce970a

Please sign in to comment.