From ff95eb73861fd2fdfe193123bf76326ecd90df34 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 10 Feb 2023 01:54:53 +0100 Subject: [PATCH] benchmark: add trailing commas in `benchmark/crypto` PR-URL: https://github.com/nodejs/node/pull/46553 Reviewed-By: Moshe Atlow Reviewed-By: Akhil Marsonya Reviewed-By: James M Snell Reviewed-By: Darshan Sen --- benchmark/.eslintrc.yaml | 1 - benchmark/crypto/aes-gcm-throughput.js | 2 +- benchmark/crypto/cipher-stream.js | 4 ++-- benchmark/crypto/get-ciphers.js | 2 +- benchmark/crypto/hash-stream-creation.js | 2 +- benchmark/crypto/hash-stream-throughput.js | 2 +- benchmark/crypto/hkdf.js | 2 +- benchmark/crypto/keygen.js | 6 +++--- benchmark/crypto/oneshot-sign-verify.js | 10 +++++----- benchmark/crypto/randomInt.js | 2 +- benchmark/crypto/rsa-encrypt-decrypt-throughput.js | 2 +- benchmark/crypto/rsa-sign-verify-throughput.js | 2 +- benchmark/crypto/webcrypto-digest.js | 2 +- 13 files changed, 19 insertions(+), 20 deletions(-) diff --git a/benchmark/.eslintrc.yaml b/benchmark/.eslintrc.yaml index 9ca9639223fe95..e212f5419a453a 100644 --- a/benchmark/.eslintrc.yaml +++ b/benchmark/.eslintrc.yaml @@ -9,7 +9,6 @@ rules: overrides: - files: - - crypto/*.js - http/*.js - path/*.js rules: diff --git a/benchmark/crypto/aes-gcm-throughput.js b/benchmark/crypto/aes-gcm-throughput.js index 3f2b9ba45eb3f2..0ac88f6e6ee5ea 100644 --- a/benchmark/crypto/aes-gcm-throughput.js +++ b/benchmark/crypto/aes-gcm-throughput.js @@ -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 }) { diff --git a/benchmark/crypto/cipher-stream.js b/benchmark/crypto/cipher-stream.js index 47a8931a540447..4e794f7afdbaac 100644 --- a/benchmark/crypto/cipher-stream.js +++ b/benchmark/crypto/cipher-stream.js @@ -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 }) { diff --git a/benchmark/crypto/get-ciphers.js b/benchmark/crypto/get-ciphers.js index 1bf910a6a80ba3..0ace9b49820db8 100644 --- a/benchmark/crypto/get-ciphers.js +++ b/benchmark/crypto/get-ciphers.js @@ -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 }) { diff --git a/benchmark/crypto/hash-stream-creation.js b/benchmark/crypto/hash-stream-creation.js index e480c7b6edcc41..5143be03263d74 100644 --- a/benchmark/crypto/hash-stream-creation.js +++ b/benchmark/crypto/hash-stream-creation.js @@ -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 }) { diff --git a/benchmark/crypto/hash-stream-throughput.js b/benchmark/crypto/hash-stream-throughput.js index b86d70604616b5..db10c439e0e446 100644 --- a/benchmark/crypto/hash-stream-throughput.js +++ b/benchmark/crypto/hash-stream-throughput.js @@ -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 }) { diff --git a/benchmark/crypto/hkdf.js b/benchmark/crypto/hkdf.js index 4be15ab59071fe..61ae33cac0a0f6 100644 --- a/benchmark/crypto/hkdf.js +++ b/benchmark/crypto/hkdf.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const assert = require('assert'); const { hkdf, - hkdfSync + hkdfSync, } = require('crypto'); const bench = common.createBenchmark(main, { diff --git a/benchmark/crypto/keygen.js b/benchmark/crypto/keygen.js index 373be24c80e5ab..264253253aca1a 100644 --- a/benchmark/crypto/keygen.js +++ b/benchmark/crypto/keygen.js @@ -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); }, diff --git a/benchmark/crypto/oneshot-sign-verify.js b/benchmark/crypto/oneshot-sign-verify.js index c37360a0c9a988..d3c70eb042469e 100644 --- a/benchmark/crypto/oneshot-sign-verify.js +++ b/benchmark/crypto/oneshot-sign-verify.js @@ -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,7 +60,7 @@ function measureAsyncSerial(n, privateKey, publicKey, keys) { data, { key: privateKey || keys[n - remaining].privateKey, - dsaEncoding: 'ieee-p1363' + dsaEncoding: 'ieee-p1363', }, (err, signature) => { crypto.verify( @@ -68,7 +68,7 @@ function measureAsyncSerial(n, privateKey, publicKey, keys) { 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); diff --git a/benchmark/crypto/randomInt.js b/benchmark/crypto/randomInt.js index 1f1dfa0160fa11..ac5286f1775e1c 100644 --- a/benchmark/crypto/randomInt.js +++ b/benchmark/crypto/randomInt.js @@ -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 }) { diff --git a/benchmark/crypto/rsa-encrypt-decrypt-throughput.js b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js index b5afe6166c9026..c5e4a8e0cc413b 100644 --- a/benchmark/crypto/rsa-encrypt-decrypt-throughput.js +++ b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js @@ -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 }) { diff --git a/benchmark/crypto/rsa-sign-verify-throughput.js b/benchmark/crypto/rsa-sign-verify-throughput.js index efa78bb867596a..ceaa2942780a8e 100644 --- a/benchmark/crypto/rsa-sign-verify-throughput.js +++ b/benchmark/crypto/rsa-sign-verify-throughput.js @@ -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 }) { diff --git a/benchmark/crypto/webcrypto-digest.js b/benchmark/crypto/webcrypto-digest.js index 7bfb486c69ea54..e2e6f55c6fdd1f 100644 --- a/benchmark/crypto/webcrypto-digest.js +++ b/benchmark/crypto/webcrypto-digest.js @@ -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