2016-06-08 08:18:26 -07:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const common = require('../common.js');
|
|
|
|
|
|
|
|
const bench = common.createBenchmark(main, {
|
2023-12-02 11:04:25 +08:00
|
|
|
n: [1, 500000],
|
2023-02-10 01:54:53 +01:00
|
|
|
v: ['crypto', 'tls'],
|
2016-06-08 08:18:26 -07:00
|
|
|
});
|
|
|
|
|
2018-01-23 13:17:56 +01:00
|
|
|
function main({ n, v }) {
|
2016-06-08 08:18:26 -07:00
|
|
|
const method = require(v).getCiphers;
|
2019-12-30 12:20:07 +01:00
|
|
|
let i = 0;
|
2018-10-06 21:09:29 -04: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 08:18:26 -07:00
|
|
|
bench.start();
|
2017-03-09 22:01:45 +01:00
|
|
|
for (i = 0; i < n; i++) method();
|
2016-06-08 08:18:26 -07:00
|
|
|
bench.end(n);
|
|
|
|
}
|