mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 15:30:56 +01:00
ea61ce518b
This removes all instances of %OptimizeFunctionOnNextCall from tls benchmarks PR-URL: https://github.com/nodejs/node/pull/9615 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
24 lines
454 B
JavaScript
24 lines
454 B
JavaScript
'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);
|
|
}
|