0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
nodejs/benchmark/tls/convertprotocols.js
James M Snell 4d00cd4ce7 tls: move convertNPNProtocols to End-of-Life
This was deprecated in 10.0.0 because NPN support was removed.
It does not make sense to keep this around longer than 10.x

PR-URL: https://github.com/nodejs/node/pull/20736
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
2018-05-17 09:53:44 -07:00

23 lines
439 B
JavaScript

'use strict';
const common = require('../common.js');
const tls = require('tls');
const bench = common.createBenchmark(main, {
n: [1, 50000]
});
function main({ n }) {
const input = ['ABC', 'XYZ123', 'FOO'];
var m = {};
// First call dominates results
if (n > 1) {
tls.convertALPNProtocols(input, m);
m = {};
}
bench.start();
for (var i = 0; i < n; i++)
tls.convertALPNProtocols(input, m);
bench.end(n);
}