Skip to content

Commit 5f700f5

Browse files
committed
benchmark: fix stdio on stderr for child process
1 parent e87f992 commit 5f700f5

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

benchmark/compare.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,11 @@ if (showProgress) {
8383
const spawnArgs = ['-c', cpuCore, cli.optional[job.binary], resolvedPath, ...cli.optional.set];
8484
child = spawn('taskset', spawnArgs, {
8585
env: process.env,
86-
stdio: ['inherit', 'pipe', 'ipc'],
86+
stdio: ['inherit', 'pipe', 'pipe'],
8787
});
8888

89-
child.stdout.on('data', (data) => {
90-
process.stdout.write(data);
91-
});
89+
child.stdout.pipe(process.stdout);
90+
child.stderr.pipe(process.stderr);
9291
} else {
9392
child = fork(resolvedPath, cli.optional.set, {
9493
execPath: cli.optional[job.binary],

benchmark/run.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,11 @@ if (format === 'csv') {
5454
let child;
5555
if (cpuCore !== null) {
5656
child = spawn('taskset', ['-c', cpuCore, 'node', scriptPath, ...args], {
57-
stdio: ['inherit', 'pipe', 'ipc'],
57+
stdio: ['inherit', 'pipe', 'pipe'],
5858
});
5959

60-
child.stdout.on('data', (data) => {
61-
process.stdout.write(data);
62-
});
60+
child.stdout.pipe(process.stdout);
61+
child.stderr.pipe(process.stderr);
6362
} else {
6463
child = fork(
6564
scriptPath,

0 commit comments

Comments
 (0)