benchmark: replace more [].join() with ''.repeat()
Refs: https://github.com/nodejs/node/pull/12170 PR-URL: https://github.com/nodejs/node/pull/12317 Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
06c29a66d4
commit
0f69f40af0
@ -19,7 +19,7 @@ function main(conf) {
|
|||||||
const dur = +conf.dur;
|
const dur = +conf.dur;
|
||||||
const len = +conf.len;
|
const len = +conf.len;
|
||||||
|
|
||||||
const msg = '"' + Array(len).join('.') + '"';
|
const msg = `"${'.'.repeat(len)}"`;
|
||||||
const options = { 'stdio': ['ignore', 'pipe', 'ignore'] };
|
const options = { 'stdio': ['ignore', 'pipe', 'ignore'] };
|
||||||
const child = spawn('yes', [msg], options);
|
const child = spawn('yes', [msg], options);
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ function main(conf) {
|
|||||||
// Chose 7 because 9 showed "Connection error" / "Connection closed"
|
// Chose 7 because 9 showed "Connection error" / "Connection closed"
|
||||||
// An odd number could result in a better length dispersion.
|
// An odd number could result in a better length dispersion.
|
||||||
for (var i = 7; i <= 7 * 7 * 7; i *= 7)
|
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) {
|
function WriteHTTPHeaders(channel, has_keep_alive, extra_header_count) {
|
||||||
todo = [];
|
todo = [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user