Skip to content

Commit

Permalink
benchmark: (tls) use destructuring
Browse files Browse the repository at this point in the history
PR-URL: nodejs#18250
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
BridgeAR authored and MayaLekova committed May 8, 2018
1 parent 14df902 commit 95026c1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
4 changes: 1 addition & 3 deletions benchmark/tls/convertprotocols.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 3 additions & 8 deletions benchmark/tls/throughput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
5 changes: 1 addition & 4 deletions benchmark/tls/tls-connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`),
Expand Down

0 comments on commit 95026c1

Please sign in to comment.