diff --git a/benchmark/crypto/randomBytes.js b/benchmark/crypto/randomBytes.js index 50ad3f08387566..a47080a017d250 100644 --- a/benchmark/crypto/randomBytes.js +++ b/benchmark/crypto/randomBytes.js @@ -3,14 +3,21 @@ const common = require('../common.js'); const { randomBytes } = require('crypto'); +// Add together with imports +const assert = require('assert'); + +let _cryptoResult; + const bench = common.createBenchmark(main, { - size: [64, 1024, 8192, 512 * 1024], - n: [1e3], + size: [64, 1024, 8 * 1024, 16 * 1024], + n: [1e5], }); function main({ n, size }) { bench.start(); for (let i = 0; i < n; ++i) - randomBytes(size); + _cryptoResult = randomBytes(size); bench.end(n); + // Avoid V8 deadcode (elimination) + assert.ok(_cryptoResult); }