Skip to content

Commit

Permalink
benchmark: fix stdio on stderr for child process
Browse files Browse the repository at this point in the history
  • Loading branch information
thisalihassan committed Apr 5, 2024
1 parent e87f992 commit b070fa2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion benchmark/compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,16 @@ if (showProgress) {
const spawnArgs = ['-c', cpuCore, cli.optional[job.binary], resolvedPath, ...cli.optional.set];
child = spawn('taskset', spawnArgs, {
env: process.env,
stdio: ['inherit', 'pipe', 'ipc'],
stdio: ['inherit', 'pipe', 'pipe'],
});

child.stdout.on('data', (data) => {
process.stdout.write(data);
});

child.stderr.on('data', (data) => {
process.stdout.write(data);
});
} else {
child = fork(resolvedPath, cli.optional.set, {
execPath: cli.optional[job.binary],
Expand Down
6 changes: 5 additions & 1 deletion benchmark/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,16 @@ if (format === 'csv') {
let child;
if (cpuCore !== null) {
child = spawn('taskset', ['-c', cpuCore, 'node', scriptPath, ...args], {
stdio: ['inherit', 'pipe', 'ipc'],
stdio: ['inherit', 'pipe', 'pipe'],
});

child.stdout.on('data', (data) => {
process.stdout.write(data);
});

child.stderr.on('data', (data) => {
process.stderr.write(data);
});
} else {
child = fork(
scriptPath,
Expand Down

0 comments on commit b070fa2

Please sign in to comment.