From d1005fb39b9c14ea9126b3e8341392c871569f64 Mon Sep 17 00:00:00 2001 From: Ali Hassan Date: Thu, 11 Apr 2024 00:41:37 +0500 Subject: [PATCH] benchmark: add ipc support to spawn stdio config Enabled inter-process communication (ipc) in the stdio configuration of the spawn function within the benchmark subsystem. This change allows for improved data exchange between parent and benchmarked child processes, addressing limitations in performance testing scenarios. Fixes: https://github.com/nodejs/node/issues/52233 Refs: https://github.com/nodejs/performance/pull/161 --- benchmark/compare.js | 2 +- benchmark/run.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmark/compare.js b/benchmark/compare.js index 1efff9e85c072f..0c53d90def371b 100644 --- a/benchmark/compare.js +++ b/benchmark/compare.js @@ -83,7 +83,7 @@ if (showProgress) { const spawnArgs = ['-c', cpuCore, cli.optional[job.binary], resolvedPath, ...cli.optional.set]; child = spawn('taskset', spawnArgs, { env: process.env, - stdio: ['inherit', 'pipe', 'pipe'], + stdio: ['inherit', 'pipe', 'pipe', 'ipc'], }); child.stdout.pipe(process.stdout); diff --git a/benchmark/run.js b/benchmark/run.js index 11f95d8e71f035..ff2d41e6056aa2 100644 --- a/benchmark/run.js +++ b/benchmark/run.js @@ -54,7 +54,7 @@ if (format === 'csv') { let child; if (cpuCore !== null) { child = spawn('taskset', ['-c', cpuCore, 'node', scriptPath, ...args], { - stdio: ['inherit', 'pipe', 'pipe'], + stdio: ['inherit', 'pipe', 'pipe', 'ipc'], }); child.stdout.pipe(process.stdout);