Skip to content

Commit e0f4360

Browse files
aduh95danielleadams
authored andcommitted
benchmark: add trailing commas in benchmark/crypto
PR-URL: #46553 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Akhil Marsonya <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
1 parent a383aee commit e0f4360

13 files changed

+19
-20
lines changed

benchmark/.eslintrc.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ rules:
99

1010
overrides:
1111
- files:
12-
- crypto/*.js
1312
- http/*.js
1413
- path/*.js
1514
rules:

benchmark/crypto/aes-gcm-throughput.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const keylen = { 'aes-128-gcm': 16, 'aes-192-gcm': 24, 'aes-256-gcm': 32 };
55
const bench = common.createBenchmark(main, {
66
n: [500],
77
cipher: ['aes-128-gcm', 'aes-192-gcm', 'aes-256-gcm'],
8-
len: [1024, 4 * 1024, 16 * 1024, 64 * 1024, 256 * 1024, 1024 * 1024]
8+
len: [1024, 4 * 1024, 16 * 1024, 64 * 1024, 256 * 1024, 1024 * 1024],
99
});
1010

1111
function main({ n, len, cipher }) {

benchmark/crypto/cipher-stream.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ const bench = common.createBenchmark(main, {
66
cipher: ['AES192', 'AES256'],
77
type: ['asc', 'utf', 'buf'],
88
len: [2, 1024, 102400, 1024 * 1024],
9-
api: ['legacy', 'stream']
9+
api: ['legacy', 'stream'],
1010
}, {
11-
flags: ['--no-warnings']
11+
flags: ['--no-warnings'],
1212
});
1313

1414
function main({ api, cipher, type, len, writes }) {

benchmark/crypto/get-ciphers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const common = require('../common.js');
44

55
const bench = common.createBenchmark(main, {
66
n: [1, 5000],
7-
v: ['crypto', 'tls']
7+
v: ['crypto', 'tls'],
88
});
99

1010
function main({ n, v }) {

benchmark/crypto/hash-stream-creation.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, {
1010
type: ['asc', 'utf', 'buf'],
1111
out: ['hex', 'binary', 'buffer'],
1212
len: [2, 1024, 102400, 1024 * 1024],
13-
api: ['legacy', 'stream']
13+
api: ['legacy', 'stream'],
1414
});
1515

1616
function main({ api, type, len, out, writes, algo }) {

benchmark/crypto/hash-stream-throughput.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const bench = common.createBenchmark(main, {
99
algo: ['sha1', 'sha256', 'sha512'],
1010
type: ['asc', 'utf', 'buf'],
1111
len: [2, 1024, 102400, 1024 * 1024],
12-
api: ['legacy', 'stream']
12+
api: ['legacy', 'stream'],
1313
});
1414

1515
function main({ api, type, len, algo, writes }) {

benchmark/crypto/hkdf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const common = require('../common.js');
44
const assert = require('assert');
55
const {
66
hkdf,
7-
hkdfSync
7+
hkdfSync,
88
} = require('crypto');
99

1010
const bench = common.createBenchmark(main, {

benchmark/crypto/keygen.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const common = require('../common.js');
44
const assert = require('assert');
55
const {
66
generateKeyPair,
7-
generateKeyPairSync
7+
generateKeyPairSync,
88
} = require('crypto');
99

1010
const bench = common.createBenchmark(main, {
@@ -18,7 +18,7 @@ const methods = {
1818
for (let i = 0; i < n; ++i) {
1919
generateKeyPairSync('rsa', {
2020
modulusLength: 1024,
21-
publicExponent: 0x10001
21+
publicExponent: 0x10001,
2222
});
2323
}
2424
bench.end(n);
@@ -35,7 +35,7 @@ const methods = {
3535
for (let i = 0; i < n; ++i)
3636
generateKeyPair('rsa', {
3737
modulusLength: 512,
38-
publicExponent: 0x10001
38+
publicExponent: 0x10001,
3939
}, done);
4040
},
4141

benchmark/crypto/oneshot-sign-verify.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const keyFixtures = {
99
publicKey: fs.readFileSync(`${fixtures_keydir}/ec_p256_public.pem`)
1010
.toString(),
1111
privateKey: fs.readFileSync(`${fixtures_keydir}/ec_p256_private.pem`)
12-
.toString()
12+
.toString(),
1313
};
1414

1515
const data = crypto.randomBytes(256);
@@ -20,7 +20,7 @@ let keyObjects;
2020
function getKeyObject({ privateKey, publicKey }) {
2121
return {
2222
privateKey: crypto.createPrivateKey(privateKey),
23-
publicKey: crypto.createPublicKey(publicKey)
23+
publicKey: crypto.createPublicKey(publicKey),
2424
};
2525
}
2626

@@ -60,15 +60,15 @@ function measureAsyncSerial(n, privateKey, publicKey, keys) {
6060
data,
6161
{
6262
key: privateKey || keys[n - remaining].privateKey,
63-
dsaEncoding: 'ieee-p1363'
63+
dsaEncoding: 'ieee-p1363',
6464
},
6565
(err, signature) => {
6666
crypto.verify(
6767
'sha256',
6868
data,
6969
{
7070
key: publicKey || keys[n - remaining].publicKey,
71-
dsaEncoding: 'ieee-p1363'
71+
dsaEncoding: 'ieee-p1363',
7272
},
7373
signature,
7474
done);
@@ -104,7 +104,7 @@ function measureAsyncParallel(n, privateKey, publicKey, keys) {
104104
function main({ n, mode, keyFormat }) {
105105
pems ||= [...Buffer.alloc(n)].map(() => ({
106106
privateKey: keyFixtures.privateKey,
107-
publicKey: keyFixtures.publicKey
107+
publicKey: keyFixtures.publicKey,
108108
}));
109109
keyObjects ||= pems.map(getKeyObject);
110110

benchmark/crypto/randomInt.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, {
77
mode: ['sync', 'async-sequential', 'async-parallel'],
88
min: [-(2 ** 47) + 1, -10_000, -100],
99
max: [100, 10_000, 2 ** 47],
10-
n: [1e3, 1e5]
10+
n: [1e3, 1e5],
1111
});
1212

1313
function main({ mode, min, max, n }) {

benchmark/crypto/rsa-encrypt-decrypt-throughput.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ keylen_list.forEach((key) => {
1919
const bench = common.createBenchmark(main, {
2020
n: [500],
2121
keylen: keylen_list,
22-
len: [16, 32, 64]
22+
len: [16, 32, 64],
2323
});
2424

2525
function main({ len, algo, keylen, n }) {

benchmark/crypto/rsa-sign-verify-throughput.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const bench = common.createBenchmark(main, {
2020
writes: [500],
2121
algo: ['SHA1', 'SHA224', 'SHA256', 'SHA384', 'SHA512'],
2222
keylen: keylen_list,
23-
len: [1024, 102400, 2 * 102400, 3 * 102400, 1024 * 1024]
23+
len: [1024, 102400, 2 * 102400, 3 * 102400, 1024 * 1024],
2424
});
2525

2626
function main({ len, algo, keylen, writes }) {

benchmark/crypto/webcrypto-digest.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const kMethods = {
1818
'SHA-1': 'sha1',
1919
'SHA-256': 'sha256',
2020
'SHA-384': 'sha384',
21-
'SHA-512': 'sha512'
21+
'SHA-512': 'sha512',
2222
};
2323

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

0 commit comments

Comments
 (0)