GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — benchmark: update iteration and size in benchmark/crypto/randomBytes.js · nodejs/node@53b16c7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • benchmark/crypto
    • randomBytes.js
Expand file treeCollapse file tree
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)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.