Skip to content

Commit 5a36035

Browse files
authored
fix(benchmark): use node flags only for memory sampling (#4681)
1 parent 6577090 commit 5a36035

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

resources/benchmark/workers.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,18 @@ export function sampleMemoryModule(modulePath: string): number {
2424
return runWorkerFile(
2525
localRepoPath('resources/benchmark/worker-memory.js'),
2626
modulePath,
27+
memoryBenchmarkNodeFlags,
2728
) as number;
2829
}
2930

30-
function runWorkerFile(workerPath: string, modulePath: string): unknown {
31+
function runWorkerFile(
32+
workerPath: string,
33+
modulePath: string,
34+
nodeFlags: ReadonlyArray<string> = [],
35+
): unknown {
3136
const result = childProcess.spawnSync(
3237
process.execPath,
33-
[...memoryBenchmarkNodeFlags, workerPath, modulePath],
38+
[...nodeFlags, workerPath, modulePath],
3439
{
3540
stdio: ['inherit', 'inherit', 'inherit', 'pipe'],
3641
env: { NODE_ENV: 'production' },

0 commit comments

Comments
 (0)