Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 53b16c7

Browse filesBrowse files
Lei ShiRafaelGSS
authored andcommitted
benchmark: update iteration and size in benchmark/crypto/randomBytes.js
Fixes: #50571 PR-URL: #50868 Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent fd028e1 commit 53b16c7
Copy full SHA for 53b16c7

File tree

Expand file treeCollapse file tree

1 file changed

+10
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-3
lines changed
Open diff view settings
Collapse file

‎benchmark/crypto/randomBytes.js‎

Copy file name to clipboardExpand all lines: benchmark/crypto/randomBytes.js
+10-3Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,21 @@
33
const common = require('../common.js');
44
const { randomBytes } = require('crypto');
55

6+
// Add together with imports
7+
const assert = require('assert');
8+
9+
let _cryptoResult;
10+
611
const bench = common.createBenchmark(main, {
7-
size: [64, 1024, 8192, 512 * 1024],
8-
n: [1e3],
12+
size: [64, 1024, 8 * 1024, 16 * 1024],
13+
n: [1e5],
914
});
1015

1116
function main({ n, size }) {
1217
bench.start();
1318
for (let i = 0; i < n; ++i)
14-
randomBytes(size);
19+
_cryptoResult = randomBytes(size);
1520
bench.end(n);
21+
// Avoid V8 deadcode (elimination)
22+
assert.ok(_cryptoResult);
1623
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.