benchmark: do not multiply n by 1e6 in arrays

PR-URL: https://github.com/nodejs/node/pull/20125
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Anatoli Papirovski 2018-04-18 12:35:47 +02:00
parent 957532ec61
commit 71cc57e472
No known key found for this signature in database
GPG Key ID: 614E2E1ABEB4B2C0
3 changed files with 6 additions and 6 deletions

View File

@ -14,14 +14,14 @@ const bench = common.createBenchmark(main, {
'Float32Array', 'Float32Array',
'Float64Array' 'Float64Array'
], ],
n: [25] n: [25e6]
}); });
function main({ type, n }) { function main({ type, n }) {
const clazz = global[type]; const clazz = global[type];
bench.start(); bench.start();
const arr = new clazz(n * 1e6); const arr = new clazz(n);
for (var i = 0; i < 10; ++i) { for (var i = 0; i < 10; ++i) {
run(); run();
} }

View File

@ -14,14 +14,14 @@ const bench = common.createBenchmark(main, {
'Float32Array', 'Float32Array',
'Float64Array' 'Float64Array'
], ],
n: [25] n: [25e6]
}); });
function main({ type, n }) { function main({ type, n }) {
const clazz = global[type]; const clazz = global[type];
bench.start(); bench.start();
const arr = new clazz(n * 1e6); const arr = new clazz(n);
for (var i = 0; i < 10; ++i) { for (var i = 0; i < 10; ++i) {
run(); run();
} }

View File

@ -14,14 +14,14 @@ const bench = common.createBenchmark(main, {
'Float32Array', 'Float32Array',
'Float64Array' 'Float64Array'
], ],
n: [25] n: [25e6]
}); });
function main({ type, n }) { function main({ type, n }) {
const clazz = global[type]; const clazz = global[type];
bench.start(); bench.start();
const arr = new clazz(n * 1e6); const arr = new clazz(n);
for (var i = 0; i < 10; ++i) { for (var i = 0; i < 10; ++i) {
run(); run();
} }