Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
benchmark: fix stdio on stderr for child process
  • Loading branch information
thisalihassan committed Apr 5, 2024
commit 5f700f58ec81acdbecf39ea3ce4e94fb0fcd630d
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);
Comment thread
thisalihassan marked this conversation as resolved.
} 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'],
});

Comment thread
mcollina marked this conversation as resolved.
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