diff options
author | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2017-04-17 04:01:12 +0300 |
---|---|---|
committer | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2017-04-20 04:46:37 +0300 |
commit | 22aa3d48997f1fc31e9c9cc08ec76a5436c93fe3 (patch) | |
tree | 255361bcfb0611af60f6c7c101c886687d0ce047 /benchmark/crypto | |
parent | bbbb1f60780d9b8ef812769e215be830c4d968b8 (diff) | |
download | android-node-v8-22aa3d48997f1fc31e9c9cc08ec76a5436c93fe3.tar.gz android-node-v8-22aa3d48997f1fc31e9c9cc08ec76a5436c93fe3.tar.bz2 android-node-v8-22aa3d48997f1fc31e9c9cc08ec76a5436c93fe3.zip |
benchmark: reduce string concatenations
PR-URL: https://github.com/nodejs/node/pull/12455
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'benchmark/crypto')
-rw-r--r-- | benchmark/crypto/cipher-stream.js | 2 | ||||
-rw-r--r-- | benchmark/crypto/hash-stream-creation.js | 2 | ||||
-rw-r--r-- | benchmark/crypto/hash-stream-throughput.js | 2 | ||||
-rw-r--r-- | benchmark/crypto/rsa-encrypt-decrypt-throughput.js | 8 | ||||
-rw-r--r-- | benchmark/crypto/rsa-sign-verify-throughput.js | 8 |
5 files changed, 11 insertions, 11 deletions
diff --git a/benchmark/crypto/cipher-stream.js b/benchmark/crypto/cipher-stream.js index 03780ba130..90bf548c76 100644 --- a/benchmark/crypto/cipher-stream.js +++ b/benchmark/crypto/cipher-stream.js @@ -51,7 +51,7 @@ function main(conf) { message = Buffer.alloc(conf.len, 'b'); break; default: - throw new Error('unknown message type: ' + conf.type); + throw new Error(`unknown message type: ${conf.type}`); } var fn = api === 'stream' ? streamWrite : legacyWrite; diff --git a/benchmark/crypto/hash-stream-creation.js b/benchmark/crypto/hash-stream-creation.js index 3be09785ac..296127ab38 100644 --- a/benchmark/crypto/hash-stream-creation.js +++ b/benchmark/crypto/hash-stream-creation.js @@ -36,7 +36,7 @@ function main(conf) { message = Buffer.alloc(conf.len, 'b'); break; default: - throw new Error('unknown message type: ' + conf.type); + throw new Error(`unknown message type: ${conf.type}`); } var fn = api === 'stream' ? streamWrite : legacyWrite; diff --git a/benchmark/crypto/hash-stream-throughput.js b/benchmark/crypto/hash-stream-throughput.js index bf426fc2c9..dbb2e5c999 100644 --- a/benchmark/crypto/hash-stream-throughput.js +++ b/benchmark/crypto/hash-stream-throughput.js @@ -35,7 +35,7 @@ function main(conf) { message = Buffer.alloc(conf.len, 'b'); break; default: - throw new Error('unknown message type: ' + conf.type); + throw new Error(`unknown message type: ${conf.type}`); } var fn = api === 'stream' ? streamWrite : legacyWrite; diff --git a/benchmark/crypto/rsa-encrypt-decrypt-throughput.js b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js index 4d98f9e2d5..b1fc339366 100644 --- a/benchmark/crypto/rsa-encrypt-decrypt-throughput.js +++ b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js @@ -10,10 +10,10 @@ var RSA_PublicPem = {}; var RSA_PrivatePem = {}; keylen_list.forEach(function(key) { - RSA_PublicPem[key] = fs.readFileSync(fixtures_keydir + - '/rsa_public_' + key + '.pem'); - RSA_PrivatePem[key] = fs.readFileSync(fixtures_keydir + - '/rsa_private_' + key + '.pem'); + RSA_PublicPem[key] = + fs.readFileSync(`${fixtures_keydir}/rsa_public_${key}.pem`); + RSA_PrivatePem[key] = + fs.readFileSync(`${fixtures_keydir}/rsa_private_${key}.pem`); }); var bench = common.createBenchmark(main, { diff --git a/benchmark/crypto/rsa-sign-verify-throughput.js b/benchmark/crypto/rsa-sign-verify-throughput.js index c5db94687a..f13dc2585a 100644 --- a/benchmark/crypto/rsa-sign-verify-throughput.js +++ b/benchmark/crypto/rsa-sign-verify-throughput.js @@ -10,10 +10,10 @@ var RSA_PublicPem = {}; var RSA_PrivatePem = {}; keylen_list.forEach(function(key) { - RSA_PublicPem[key] = fs.readFileSync(fixtures_keydir + - '/rsa_public_' + key + '.pem'); - RSA_PrivatePem[key] = fs.readFileSync(fixtures_keydir + - '/rsa_private_' + key + '.pem'); + RSA_PublicPem[key] = + fs.readFileSync(`${fixtures_keydir}/rsa_public_${key}.pem`); + RSA_PrivatePem[key] = + fs.readFileSync(`${fixtures_keydir}/rsa_private_${key}.pem`); }); var bench = common.createBenchmark(main, { |