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 5f700f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions benchmark/compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,11 @@ 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.stdout.pipe(process.stdout);
child.stderr.pipe(process.stderr);
} else {
child = fork(resolvedPath, cli.optional.set, {
execPath: cli.optional[job.binary],
Expand Down
7 changes: 3 additions & 4 deletions benchmark/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,11 @@ 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.stdout.pipe(process.stdout);
child.stderr.pipe(process.stderr);
} else {
child = fork(
scriptPath,
Expand Down

0 comments on commit 5f700f5

Please sign in to comment.