benchmark: (tls) use destructuring

PR-URL: https://github.com/nodejs/node/pull/18250
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Ruben Bridgewater 2017-12-30 03:55:51 +01:00
parent 7a24b1c565
commit e49d86437d
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762
3 changed files with 5 additions and 15 deletions

View File

@ -7,9 +7,7 @@ const bench = common.createBenchmark(main, {
n: [1, 50000]
});
function main(conf) {
const n = +conf.n;
function main({ n }) {
var i = 0;
var m = {};
// First call dominates results

View File

@ -6,20 +6,15 @@ const bench = common.createBenchmark(main, {
size: [2, 1024, 1024 * 1024]
});
var dur, type, encoding, size;
var server;
const path = require('path');
const fs = require('fs');
const cert_dir = path.resolve(__dirname, '../../test/fixtures');
var options;
const tls = require('tls');
function main(conf) {
dur = +conf.dur;
type = conf.type;
size = +conf.size;
function main({ dur, type, size }) {
var encoding;
var server;
var chunk;
switch (type) {
case 'buf':

View File

@ -16,10 +16,7 @@ var dur;
var concurrency;
var running = true;
function main(conf) {
dur = +conf.dur;
concurrency = +conf.concurrency;
function main({ dur, concurrency }) {
const cert_dir = path.resolve(__dirname, '../../test/fixtures');
const options = {
key: fs.readFileSync(`${cert_dir}/test_key.pem`),