2016-06-08 17:18:26 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const common = require('../common.js');
|
|
|
|
|
|
|
|
const bench = common.createBenchmark(main, {
|
|
|
|
n: [1, 5000],
|
|
|
|
v: ['crypto', 'tls']
|
|
|
|
});
|
|
|
|
|
2018-01-23 13:17:56 +01:00
|
|
|
function main({ n, v }) {
|
2016-06-08 17:18:26 +02:00
|
|
|
const method = require(v).getCiphers;
|
|
|
|
var i = 0;
|
2018-10-07 03:09:29 +02:00
|
|
|
// First call to getCiphers will dominate the results
|
2017-02-28 18:44:14 +01:00
|
|
|
if (n > 1) {
|
|
|
|
for (; i < n; i++)
|
|
|
|
method();
|
|
|
|
}
|
2016-06-08 17:18:26 +02:00
|
|
|
bench.start();
|
2017-03-09 22:01:45 +01:00
|
|
|
for (i = 0; i < n; i++) method();
|
2016-06-08 17:18:26 +02:00
|
|
|
bench.end(n);
|
|
|
|
}
|