Skip to content

Commit

Permalink
benchmark: add trailing commas in benchmark/crypto
Browse files Browse the repository at this point in the history
PR-URL: #46553
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
aduh95 authored and danielleadams committed Apr 3, 2023
1 parent a383aee commit e0f4360
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 20 deletions.
1 change: 0 additions & 1 deletion benchmark/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ rules:

overrides:
- files:
- crypto/*.js
- http/*.js
- path/*.js
rules:
Expand Down
2 changes: 1 addition & 1 deletion benchmark/crypto/aes-gcm-throughput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) {
Expand Down
4 changes: 2 additions & 2 deletions benchmark/crypto/cipher-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/crypto/get-ciphers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/crypto/hash-stream-creation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/crypto/hash-stream-throughput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/crypto/hkdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const common = require('../common.js');
const assert = require('assert');
const {
hkdf,
hkdfSync
hkdfSync,
} = require('crypto');

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

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

Expand Down
10 changes: 5 additions & 5 deletions benchmark/crypto/oneshot-sign-verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -20,7 +20,7 @@ let keyObjects;
function getKeyObject({ privateKey, publicKey }) {
return {
privateKey: crypto.createPrivateKey(privateKey),
publicKey: crypto.createPublicKey(publicKey)
publicKey: crypto.createPublicKey(publicKey),
};
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion benchmark/crypto/randomInt.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/crypto/rsa-encrypt-decrypt-throughput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/crypto/rsa-sign-verify-throughput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/crypto/webcrypto-digest.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,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
Expand Down

0 comments on commit e0f4360

Please sign in to comment.