Skip to content

Commit e4c3e83

Browse files
fix(core): be minimalistic about walltime node flags
1 parent ee01e40 commit e4c3e83

1 file changed

Lines changed: 24 additions & 17 deletions

File tree

packages/core/src/introspection.ts

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
11
import { writeFileSync } from "fs";
2+
import { getCodspeedRunnerMode } from ".";
23

34
const CUSTOM_INTROSPECTION_EXIT_CODE = 0;
45

56
export const getV8Flags = () => {
67
const nodeVersionMajor = parseInt(process.version.slice(1).split(".")[0]);
8+
const codspeedRunnerMode = getCodspeedRunnerMode();
79

8-
const flags = [
9-
"--hash-seed=1",
10-
"--random-seed=1",
11-
"--no-opt",
12-
"--predictable",
13-
"--predictable-gc-schedule",
14-
"--interpreted-frames-native-stack",
15-
"--allow-natives-syntax",
16-
"--expose-gc",
17-
"--no-concurrent-sweeping",
18-
"--max-old-space-size=4096",
19-
];
20-
if (nodeVersionMajor < 18) {
21-
flags.push("--no-randomize-hashes");
22-
}
23-
if (nodeVersionMajor < 20) {
24-
flags.push("--no-scavenge-task");
10+
const flags = ["--interpreted-frames-native-stack", "--allow-natives-syntax"];
11+
12+
if (codspeedRunnerMode === "instrumented") {
13+
flags.push(
14+
...[
15+
"--hash-seed=1",
16+
"--random-seed=1",
17+
"--no-opt",
18+
"--predictable",
19+
"--predictable-gc-schedule",
20+
"--expose-gc",
21+
"--no-concurrent-sweeping",
22+
"--max-old-space-size=4096",
23+
]
24+
);
25+
if (nodeVersionMajor < 18) {
26+
flags.push("--no-randomize-hashes");
27+
}
28+
if (nodeVersionMajor < 20) {
29+
flags.push("--no-scavenge-task");
30+
}
2531
}
32+
2633
return flags;
2734
};
2835

0 commit comments

Comments
 (0)