Skip to content

Commit

Permalink
feat: add a custom node script that adds codspeed v8 flags
Browse files Browse the repository at this point in the history
  • Loading branch information
adriencaccia committed Jun 22, 2023
1 parent 32e1b73 commit 4a4c3e7
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist/** -diff linguist-generated=true
dist/** -diff linguist-generated=true
dist/node -diff linguist-generated=false
42 changes: 42 additions & 0 deletions dist/bin/node

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions dist/index.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/index.js.map

Large diffs are not rendered by default.

14 changes: 5 additions & 9 deletions src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ const run = async (inputs: ActionInputs): Promise<{profileFolder: string}> => {
// Fixes a compatibility issue with cargo 1.66+ running directly under valgrind <3.20
const benchCommand = inputs.run.replace("cargo codspeed", "cargo-codspeed");

const customBinPath = `${__dirname}/bin`;
core.debug(`custom bin path: ${customBinPath}`);

try {
await exec(
[
Expand All @@ -85,17 +88,10 @@ const run = async (inputs: ActionInputs): Promise<{profileFolder: string}> => {
{
env: {
...process.env,
// prepend the custom dist/bin folder to the path, to run our custom node script instead of the regular node
PATH: `${customBinPath}:${process.env.PATH}`,
PYTHONMALLOC: "malloc",
PYTHONHASHSEED: "0",
CODSPEED_V8_FLAGS: [
"--hash-seed=1",
"--random-seed=1",
"--no-randomize-hashes",
"--no-scavenge-task",
"--no-opt ",
"--predictable ",
"--predictable-gc-schedule",
].join(" "),
ARCH: arch,
CODSPEED_ENV: "github",
},
Expand Down

0 comments on commit 4a4c3e7

Please sign in to comment.