Skip to content

Commit b5b3049

Browse files
committed
chore: patch codspeed
(cherry picked from commit 57d1f7f4bbcf55b22758f516911e335528b42cc6)
1 parent 9c771c0 commit b5b3049

File tree

3 files changed

+50
-16
lines changed

3 files changed

+50
-16
lines changed

patches/@codspeed+core+3.1.0.patch

Lines changed: 0 additions & 16 deletions
This file was deleted.

patches/@codspeed+core+3.1.1.patch

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
diff --git a/node_modules/@codspeed/core/dist/index.cjs.js b/node_modules/@codspeed/core/dist/index.cjs.js
2+
index 5087584..64fa54a 100644
3+
--- a/node_modules/@codspeed/core/dist/index.cjs.js
4+
+++ b/node_modules/@codspeed/core/dist/index.cjs.js
5+
@@ -25,8 +25,12 @@ const getV8Flags = () => {
6+
"--random-seed=1",
7+
"--no-opt",
8+
"--predictable",
9+
+ "--expose-gc"
10+
"--predictable-gc-schedule",
11+
- "--interpreted-frames-native-stack"
12+
+ "--interpreted-frames-native-stack",
13+
+ // "--jitless",
14+
+ '--no-concurrent-sweeping',
15+
+ '--max-old-space-size=4096',
16+
];
17+
if (nodeVersionMajor < 18) {
18+
flags.push("--no-randomize-hashes");
19+
@@ -18861,6 +18865,9 @@ const optimizeFunction = async (fn) => {
20+
}
21+
await fn();
22+
await fn();
23+
+ await fn();
24+
+ await fn();
25+
+ await fn();
26+
eval("%OptimizeFunctionOnNextCall(fn)");
27+
await fn();
28+
};
29+
@@ -18871,6 +18878,9 @@ const optimizeFunctionSync = (fn) => {
30+
}
31+
fn();
32+
fn();
33+
+ fn();
34+
+ fn();
35+
+ fn();
36+
eval("%OptimizeFunctionOnNextCall(fn)");
37+
fn();
38+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/node_modules/@codspeed/vitest-plugin/dist/runner.mjs b/node_modules/@codspeed/vitest-plugin/dist/runner.mjs
2+
index f4c6c95..ee26264 100644
3+
--- a/node_modules/@codspeed/vitest-plugin/dist/runner.mjs
4+
+++ b/node_modules/@codspeed/vitest-plugin/dist/runner.mjs
5+
@@ -32,6 +32,7 @@ async function runBench(benchmark, currentSuiteName) {
6+
throw e;
7+
}
8+
}
9+
+ global.gc();
10+
await callSuiteHook(benchmark.suite, benchmark, "afterEach");
11+
await callSuiteHook(benchmark.suite, benchmark, "beforeEach");
12+
await mongoMeasurement.start(uri);

0 commit comments

Comments
 (0)