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.
 
 
 
 
 
 

20 lines
420 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 = {};
common.v8ForceOptimization(
tls.convertNPNProtocols, ['ABC', 'XYZ123', 'FOO'], m);
bench.start();
for (; i < n; i++) tls.convertNPNProtocols(['ABC', 'XYZ123', 'FOO'], m);
bench.end(n);
}