Skip to content

Commit d5bc52a

Browse files
committed
benchmark: use 'yes' instead of echo in a loop
This changes child-process-exec-stdout benchmark to use 'yes' instead of echo in a while loop. This makes this benchmark consistent with child-process-read which already uses `yes` and allows this benchmark to be executed on Windows. Reviewed-By: Ben Noordhuis <[email protected]> PR-URL: nodejs#8721
1 parent 9e5a06e commit d5bc52a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

benchmark/child_process/child-process-exec-stdout.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ function main(conf) {
2020
const msg = `"${'.'.repeat(len)}"`;
2121
msg.match(/./);
2222
const options = {'stdio': ['ignore', 'pipe', 'ignore']};
23-
// NOTE: Command below assumes bash shell.
24-
const child = exec(`while\n echo ${msg}\ndo :; done\n`, options);
23+
const child = exec(`yes ${msg}`, options);
2524

2625
var bytes = 0;
2726
child.stdout.on('data', function(msg) {

0 commit comments

Comments
 (0)