Skip to content

Commit

Permalink
benchmark: replace more [].join() with ''.repeat()
Browse files Browse the repository at this point in the history
Refs: #12170

PR-URL: #12317
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
vsemozhetbyt authored and evanlucas committed May 2, 2017
1 parent 94ddab0 commit f316b50
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion benchmark/child_process/child-process-read.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function main(conf) {
const dur = +conf.dur;
const len = +conf.len;

const msg = '"' + Array(len).join('.') + '"';
const msg = `"${'.'.repeat(len)}"`;
const options = { 'stdio': ['ignore', 'pipe', 'ignore'] };
const child = spawn('yes', [msg], options);

Expand Down
2 changes: 1 addition & 1 deletion benchmark/http/_chunky_http_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function main(conf) {
// Chose 7 because 9 showed "Connection error" / "Connection closed"
// An odd number could result in a better length dispersion.
for (var i = 7; i <= 7 * 7 * 7; i *= 7)
headers.push(Array(i + 1).join('o'));
headers.push('o'.repeat(i));

function WriteHTTPHeaders(channel, has_keep_alive, extra_header_count) {
todo = [];
Expand Down

0 comments on commit f316b50

Please sign in to comment.