Skip to content

benchmark: add trailing commas in benchmark/crypto #46553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion benchmark/.eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ rules:

overrides:
- files:
- crypto/*.js
- http/*.js
- http2/*.js
- path/*.js
2 changes: 1 addition & 1 deletion benchmark/crypto/aes-gcm-throughput.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ const keylen = { 'aes-128-gcm': 16, 'aes-192-gcm': 24, 'aes-256-gcm': 32 };
const bench = common.createBenchmark(main, {
n: [500],
cipher: ['aes-128-gcm', 'aes-192-gcm', 'aes-256-gcm'],
len: [1024, 4 * 1024, 16 * 1024, 64 * 1024, 256 * 1024, 1024 * 1024]
len: [1024, 4 * 1024, 16 * 1024, 64 * 1024, 256 * 1024, 1024 * 1024],
});

function main({ n, len, cipher }) {
4 changes: 2 additions & 2 deletions benchmark/crypto/cipher-stream.js
Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@ const bench = common.createBenchmark(main, {
cipher: ['AES192', 'AES256'],
type: ['asc', 'utf', 'buf'],
len: [2, 1024, 102400, 1024 * 1024],
api: ['legacy', 'stream']
api: ['legacy', 'stream'],
}, {
flags: ['--no-warnings']
flags: ['--no-warnings'],
});

function main({ api, cipher, type, len, writes }) {
2 changes: 1 addition & 1 deletion benchmark/crypto/get-ciphers.js
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ const common = require('../common.js');

const bench = common.createBenchmark(main, {
n: [1, 5000],
v: ['crypto', 'tls']
v: ['crypto', 'tls'],
});

function main({ n, v }) {
2 changes: 1 addition & 1 deletion benchmark/crypto/hash-stream-creation.js
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, {
type: ['asc', 'utf', 'buf'],
out: ['hex', 'binary', 'buffer'],
len: [2, 1024, 102400, 1024 * 1024],
api: ['legacy', 'stream']
api: ['legacy', 'stream'],
});

function main({ api, type, len, out, writes, algo }) {
2 changes: 1 addition & 1 deletion benchmark/crypto/hash-stream-throughput.js
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ const bench = common.createBenchmark(main, {
algo: ['sha1', 'sha256', 'sha512'],
type: ['asc', 'utf', 'buf'],
len: [2, 1024, 102400, 1024 * 1024],
api: ['legacy', 'stream']
api: ['legacy', 'stream'],
});

function main({ api, type, len, algo, writes }) {
2 changes: 1 addition & 1 deletion benchmark/crypto/hkdf.js
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ const common = require('../common.js');
const assert = require('assert');
const {
hkdf,
hkdfSync
hkdfSync,
} = require('crypto');

const bench = common.createBenchmark(main, {
6 changes: 3 additions & 3 deletions benchmark/crypto/keygen.js
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ const common = require('../common.js');
const assert = require('assert');
const {
generateKeyPair,
generateKeyPairSync
generateKeyPairSync,
} = require('crypto');

const bench = common.createBenchmark(main, {
@@ -18,7 +18,7 @@ const methods = {
for (let i = 0; i < n; ++i) {
generateKeyPairSync('rsa', {
modulusLength: 1024,
publicExponent: 0x10001
publicExponent: 0x10001,
});
}
bench.end(n);
@@ -35,7 +35,7 @@ const methods = {
for (let i = 0; i < n; ++i)
generateKeyPair('rsa', {
modulusLength: 512,
publicExponent: 0x10001
publicExponent: 0x10001,
}, done);
},

10 changes: 5 additions & 5 deletions benchmark/crypto/oneshot-sign-verify.js
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ const keyFixtures = {
publicKey: fs.readFileSync(`${fixtures_keydir}/ec_p256_public.pem`)
.toString(),
privateKey: fs.readFileSync(`${fixtures_keydir}/ec_p256_private.pem`)
.toString()
.toString(),
};

const data = crypto.randomBytes(256);
@@ -20,7 +20,7 @@ let keyObjects;
function getKeyObject({ privateKey, publicKey }) {
return {
privateKey: crypto.createPrivateKey(privateKey),
publicKey: crypto.createPublicKey(publicKey)
publicKey: crypto.createPublicKey(publicKey),
};
}

@@ -60,15 +60,15 @@ function measureAsyncSerial(n, privateKey, publicKey, keys) {
data,
{
key: privateKey || keys[n - remaining].privateKey,
dsaEncoding: 'ieee-p1363'
dsaEncoding: 'ieee-p1363',
},
(err, signature) => {
crypto.verify(
'sha256',
data,
{
key: publicKey || keys[n - remaining].publicKey,
dsaEncoding: 'ieee-p1363'
dsaEncoding: 'ieee-p1363',
},
signature,
done);
@@ -104,7 +104,7 @@ function measureAsyncParallel(n, privateKey, publicKey, keys) {
function main({ n, mode, keyFormat }) {
pems ||= [...Buffer.alloc(n)].map(() => ({
privateKey: keyFixtures.privateKey,
publicKey: keyFixtures.publicKey
publicKey: keyFixtures.publicKey,
}));
keyObjects ||= pems.map(getKeyObject);

2 changes: 1 addition & 1 deletion benchmark/crypto/randomInt.js
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, {
mode: ['sync', 'async-sequential', 'async-parallel'],
min: [-(2 ** 47) + 1, -10_000, -100],
max: [100, 10_000, 2 ** 47],
n: [1e3, 1e5]
n: [1e3, 1e5],
});

function main({ mode, min, max, n }) {
2 changes: 1 addition & 1 deletion benchmark/crypto/rsa-encrypt-decrypt-throughput.js
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ keylen_list.forEach((key) => {
const bench = common.createBenchmark(main, {
n: [500],
keylen: keylen_list,
len: [16, 32, 64]
len: [16, 32, 64],
});

function main({ len, algo, keylen, n }) {
2 changes: 1 addition & 1 deletion benchmark/crypto/rsa-sign-verify-throughput.js
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ const bench = common.createBenchmark(main, {
writes: [500],
algo: ['SHA1', 'SHA224', 'SHA256', 'SHA384', 'SHA512'],
keylen: keylen_list,
len: [1024, 102400, 2 * 102400, 3 * 102400, 1024 * 1024]
len: [1024, 102400, 2 * 102400, 3 * 102400, 1024 * 1024],
});

function main({ len, algo, keylen, writes }) {
2 changes: 1 addition & 1 deletion benchmark/crypto/webcrypto-digest.js
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ const kMethods = {
'SHA-1': 'sha1',
'SHA-256': 'sha256',
'SHA-384': 'sha384',
'SHA-512': 'sha512'
'SHA-512': 'sha512',
};

// This benchmark only looks at clock time and ignores factors