Skip to content

Commit

Permalink
chore: patch codspeed
Browse files Browse the repository at this point in the history
  • Loading branch information
erikwrede committed Oct 20, 2024
1 parent 116c421 commit 57d1f7f
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 16 deletions.
16 changes: 0 additions & 16 deletions patches/@codspeed+core+3.1.0.patch

This file was deleted.

38 changes: 38 additions & 0 deletions patches/@codspeed+core+3.1.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
diff --git a/node_modules/@codspeed/core/dist/index.cjs.js b/node_modules/@codspeed/core/dist/index.cjs.js
index 5087584..64fa54a 100644
--- a/node_modules/@codspeed/core/dist/index.cjs.js
+++ b/node_modules/@codspeed/core/dist/index.cjs.js
@@ -25,8 +25,12 @@ const getV8Flags = () => {
"--random-seed=1",
"--no-opt",
"--predictable",
+ "--expose-gc"
"--predictable-gc-schedule",
- "--interpreted-frames-native-stack"
+ "--interpreted-frames-native-stack",
+ // "--jitless",
+ '--no-concurrent-sweeping',
+ '--max-old-space-size=4096',
];
if (nodeVersionMajor < 18) {
flags.push("--no-randomize-hashes");
@@ -18861,6 +18865,9 @@ const optimizeFunction = async (fn) => {
}
await fn();
await fn();
+ await fn();
+ await fn();
+ await fn();
eval("%OptimizeFunctionOnNextCall(fn)");
await fn();
};
@@ -18871,6 +18878,9 @@ const optimizeFunctionSync = (fn) => {
}
fn();
fn();
+ fn();
+ fn();
+ fn();
eval("%OptimizeFunctionOnNextCall(fn)");
fn();
};
12 changes: 12 additions & 0 deletions patches/@codspeed+vitest-plugin+3.1.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/node_modules/@codspeed/vitest-plugin/dist/runner.mjs b/node_modules/@codspeed/vitest-plugin/dist/runner.mjs
index f4c6c95..ee26264 100644
--- a/node_modules/@codspeed/vitest-plugin/dist/runner.mjs
+++ b/node_modules/@codspeed/vitest-plugin/dist/runner.mjs
@@ -32,6 +32,7 @@ async function runBench(benchmark, currentSuiteName) {
throw e;
}
}
+ global.gc();
await callSuiteHook(benchmark.suite, benchmark, "afterEach");
await callSuiteHook(benchmark.suite, benchmark, "beforeEach");
await mongoMeasurement.start(uri);

0 comments on commit 57d1f7f

Please sign in to comment.