summaryrefslogtreecommitdiff
path: root/benchmark/child_process
diff options
context:
space:
mode:
authorBartosz Sosnowski <bartosz@janeasystems.com>2016-09-22 13:00:27 +0200
committerBartosz Sosnowski <bartosz@janeasystems.com>2016-09-26 17:23:50 +0200
commitd5bc52aa2e324e2cbb6da38a505ff956058b4e76 (patch)
tree67f5de0ecaea079b58a61d85bbc1181473ebfc97 /benchmark/child_process
parent9e5a06ecf67442afa3e6f2cb62077e7de12de4e1 (diff)
downloadandroid-node-v8-d5bc52aa2e324e2cbb6da38a505ff956058b4e76.tar.gz
android-node-v8-d5bc52aa2e324e2cbb6da38a505ff956058b4e76.tar.bz2
android-node-v8-d5bc52aa2e324e2cbb6da38a505ff956058b4e76.zip
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 <info@bnoordhuis.nl> PR-URL: https://github.com/nodejs/node/pull/8721
Diffstat (limited to 'benchmark/child_process')
-rw-r--r--benchmark/child_process/child-process-exec-stdout.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/benchmark/child_process/child-process-exec-stdout.js b/benchmark/child_process/child-process-exec-stdout.js
index 6194f66b55..7b93aacff8 100644
--- a/benchmark/child_process/child-process-exec-stdout.js
+++ b/benchmark/child_process/child-process-exec-stdout.js
@@ -20,8 +20,7 @@ function main(conf) {
const msg = `"${'.'.repeat(len)}"`;
msg.match(/./);
const options = {'stdio': ['ignore', 'pipe', 'ignore']};
- // NOTE: Command below assumes bash shell.
- const child = exec(`while\n echo ${msg}\ndo :; done\n`, options);
+ const child = exec(`yes ${msg}`, options);
var bytes = 0;
child.stdout.on('data', function(msg) {