Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,18 @@ jobs:

- name: Run benchmarks with tinybench-plugin
# use version from `main` branch to always test the latest version, in real projects, use a tag, like `@v2`
uses: CodSpeedHQ/action@v3
uses: CodSpeedHQ/action@main
with:
mode: instrumentation
run: pnpm --filter ${{ matrix.example }} bench-tinybench
env:
CODSPEED_SKIP_UPLOAD: true
CODSPEED_DEBUG: true
- name: Run benchmarks with benchmark.js-plugin
# use version from `main` branch to always test the latest version, in real projects, use a tag, like `@v2`
uses: CodSpeedHQ/action@v3
uses: CodSpeedHQ/action@main
with:
mode: instrumentation
run: pnpm --filter ${{ matrix.example }} bench-benchmark-js
env:
CODSPEED_SKIP_UPLOAD: true
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ jobs:

- name: Run benchmarks
# use version from `main` branch to always test the latest version, in real projects, use a tag, like `@v2`
uses: CodSpeedHQ/action@v3
uses: CodSpeedHQ/action@main
with:
mode: instrumentation
run: |
pnpm moon run tinybench-plugin:bench
pnpm moon run vitest-plugin:bench
Expand All @@ -53,8 +54,9 @@ jobs:

- name: Run benchmarks
# use version from `main` branch to always test the latest version, in real projects, use a tag, like `@v2`
uses: CodSpeedHQ/action@v3
uses: CodSpeedHQ/action@main
with:
mode: walltime
run: |
pnpm moon run tinybench-plugin:bench
pnpm moon run vitest-plugin:bench
Expand Down
41 changes: 24 additions & 17 deletions packages/core/src/introspection.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
import { writeFileSync } from "fs";
import { getCodspeedRunnerMode } from ".";

const CUSTOM_INTROSPECTION_EXIT_CODE = 0;

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

const flags = [
"--hash-seed=1",
"--random-seed=1",
"--no-opt",
"--predictable",
"--predictable-gc-schedule",
"--interpreted-frames-native-stack",
"--allow-natives-syntax",
"--expose-gc",
"--no-concurrent-sweeping",
"--max-old-space-size=4096",
];
if (nodeVersionMajor < 18) {
flags.push("--no-randomize-hashes");
}
if (nodeVersionMajor < 20) {
flags.push("--no-scavenge-task");
const flags = ["--interpreted-frames-native-stack", "--allow-natives-syntax"];

if (codspeedRunnerMode === "instrumented") {
flags.push(
...[
"--hash-seed=1",
"--random-seed=1",
"--no-opt",
"--predictable",
"--predictable-gc-schedule",
"--expose-gc",
"--no-concurrent-sweeping",
"--max-old-space-size=4096",
]
);
if (nodeVersionMajor < 18) {
flags.push("--no-randomize-hashes");
}
if (nodeVersionMajor < 20) {
flags.push("--no-scavenge-task");
}
}

return flags;
};

Expand Down
4 changes: 2 additions & 2 deletions packages/vitest-plugin/src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ describe("codSpeedPlugin", () => {
poolOptions: {
forks: {
execArgv: [
"--interpreted-frames-native-stack",
"--allow-natives-syntax",
"--hash-seed=1",
"--random-seed=1",
"--no-opt",
"--predictable",
"--predictable-gc-schedule",
"--interpreted-frames-native-stack",
"--allow-natives-syntax",
"--expose-gc",
"--no-concurrent-sweeping",
"--max-old-space-size=4096",
Expand Down
Loading