mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
454 B
23 lines
454 B
'use strict';
|
|
|
|
const common = require('../common.js');
|
|
const tls = require('tls');
|
|
|
|
const bench = common.createBenchmark(main, {
|
|
n: [1, 50000]
|
|
});
|
|
|
|
function main(conf) {
|
|
const n = +conf.n;
|
|
|
|
var i = 0;
|
|
var m = {};
|
|
// First call dominates results
|
|
if (n > 1) {
|
|
tls.convertNPNProtocols(['ABC', 'XYZ123', 'FOO'], m);
|
|
m = {};
|
|
}
|
|
bench.start();
|
|
for (; i < n; i++) tls.convertNPNProtocols(['ABC', 'XYZ123', 'FOO'], m);
|
|
bench.end(n);
|
|
}
|
|
|