Skip to content

Commit a511177

Browse files
ci: stability benchmarks (#20574)
1 parent c18831d commit a511177

4 files changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/benchmarks.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ jobs:
4242

4343
- run: yarn link webpack --frozen-lockfile
4444

45+
- name: Check Memory Status
46+
run: >
47+
node -e 'const os=require("os");
48+
const toGb=b=>(b/1024**3).toFixed(2)+" GB";
49+
console.log(`--- Memory Status ---\nTotal: ${toGb(os.totalmem())}\nFree: ${toGb(os.freemem())}\nUsed: ${toGb(os.totalmem()-os.freemem())}`)'
50+
4551
- name: Run benchmarks
4652
uses: CodSpeedHQ/action@2ac572851726409c88c02a307f1ea2632a9ea59b # v4.11.0
4753
with:
@@ -77,7 +83,7 @@ jobs:
7783

7884
- run: yarn link webpack --frozen-lockfile
7985

80-
- name: Run benchmarks
86+
- name: Run memory benchmarks
8187
uses: CodSpeedHQ/action@2ac572851726409c88c02a307f1ea2632a9ea59b # v4.11.0
8288
with:
8389
run: yarn benchmark --ci

cspell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
"fileoverview",
9797
"filepath",
9898
"finalizer",
99+
"freemem",
99100
"fsevents",
100101
"fullhash",
101102
"funcindex",
@@ -272,6 +273,7 @@
272273
"timestamping",
273274
"tmpl",
274275
"toplevel",
276+
"totalmem",
275277
"tonumber",
276278
"traceur",
277279
"transpile",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"fix:code": "yarn lint:code --fix",
5050
"fix:special": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-schemas --write && node tooling/generate-runtime-code.js --write && node tooling/generate-wasm-code.js --write && node node_modules/tooling/compile-to-definitions --write && node node_modules/tooling/precompile-schemas --write && node node_modules/tooling/generate-types --no-template-literals --write",
5151
"build:examples": "cd examples && node buildAll.js",
52-
"benchmark": "node --max-old-space-size=4096 --experimental-vm-modules --trace-deprecation --hash-seed=1 --random-seed=1 --no-opt --predictable --predictable-gc-schedule --interpreted-frames-native-stack --allow-natives-syntax --expose-gc --no-concurrent-sweeping ./test/BenchmarkTestCases.benchmark.mjs",
52+
"benchmark": "node --max-old-space-size=6144 --experimental-vm-modules --trace-deprecation --hash-seed=1 --random-seed=1 --no-opt --predictable --predictable-gc-schedule --interpreted-frames-native-stack --allow-natives-syntax --expose-gc --no-concurrent-sweeping ./test/BenchmarkTestCases.benchmark.mjs",
5353
"pretest": "yarn lint",
5454
"test": "yarn test:base",
5555
"test:base": "node --expose-gc --max-old-space-size=4096 --experimental-vm-modules --trace-deprecation node_modules/jest-cli/bin/jest --logHeapUsage",

test/BenchmarkTestCases.benchmark.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ const git = simpleGit(rootPath);
3232
const REV_LIST_REGEXP = /^([a-f0-9]+)\s*([a-f0-9]+)\s*([a-f0-9]+)?\s*$/;
3333

3434
const checkV8Flags = () => {
35-
const requiredFlags = getV8Flags();
35+
const requiredFlags = getV8Flags().filter(
36+
(flag) => !flag.startsWith("--max-old-space-size")
37+
);
3638
const actualFlags = process.execArgv;
3739
const missingFlags = requiredFlags.filter(
3840
(flag) => !actualFlags.includes(flag)

0 commit comments

Comments
 (0)