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: nodejs#52233
Refs: nodejs/performance#161
  • Loading branch information
thisalihassan committed Apr 10, 2024
1 parent 756acd0 commit d1005fb
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 d1005fb

Please sign in to comment.