Skip to content

Commit

Permalink
benchmark: add ipc support to spawn stdio config
Browse files Browse the repository at this point in the history
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: #52233
Refs: nodejs/performance#161
PR-URL: #52456
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Raz Luvaton <[email protected]>
  • Loading branch information
thisalihassan authored and marco-ippolito committed May 3, 2024
1 parent 1c1a693 commit 0300598
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion benchmark/compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion benchmark/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0300598

Please sign in to comment.