mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 10:15:07 +08:00
lib: deprecate _http_*
Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com> PR-URL: https://github.com/nodejs/node/pull/58535 Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Aviv Keller <me@aviv.sh>
This commit is contained in:
1 parent
e39f2e8cff
commit
12ce81920a
51 files changed
+6254
-5892
No files matched your search
@@ -1,7 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const common = require('../common.js');
|
||||
const _checkInvalidHeaderChar = require('_http_common')._checkInvalidHeaderChar;
|
||||
|
||||
const groupedInputs = {
|
||||
// Representative set of inputs from an AcmeAir benchmark run:
|
||||
@@ -51,9 +50,13 @@ const inputs = [
|
||||
const bench = common.createBenchmark(main, {
|
||||
input: inputs.concat(Object.keys(groupedInputs)),
|
||||
n: [1e6],
|
||||
}, {
|
||||
flags: ['--expose-internals', '--no-warnings'],
|
||||
});
|
||||
|
||||
function main({ n, input }) {
|
||||
const checkInvalidHeaderChar = require('internal/http/common')._checkInvalidHeaderChar;
|
||||
|
||||
let inputs = [input];
|
||||
if (Object.hasOwn(groupedInputs, input)) {
|
||||
inputs = groupedInputs[input];
|
||||
@@ -62,7 +65,7 @@ function main({ n, input }) {
|
||||
const len = inputs.length;
|
||||
bench.start();
|
||||
for (let i = 0; i < n; i++) {
|
||||
_checkInvalidHeaderChar(inputs[i % len]);
|
||||
checkInvalidHeaderChar(inputs[i % len]);
|
||||
}
|
||||
bench.end(n);
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const common = require('../common.js');
|
||||
const _checkIsHttpToken = require('_http_common')._checkIsHttpToken;
|
||||
|
||||
const bench = common.createBenchmark(main, {
|
||||
key: [
|
||||
@@ -38,12 +37,16 @@ const bench = common.createBenchmark(main, {
|
||||
'alternate-protocol:', // slow bailout
|
||||
],
|
||||
n: [1e6],
|
||||
}, {
|
||||
flags: ['--expose-internals', '--no-warnings'],
|
||||
});
|
||||
|
||||
function main({ n, key }) {
|
||||
const checkIsHttpToken = require('internal/http/common')._checkIsHttpToken;
|
||||
|
||||
bench.start();
|
||||
for (let i = 0; i < n; i++) {
|
||||
_checkIsHttpToken(key);
|
||||
checkIsHttpToken(key);
|
||||
}
|
||||
bench.end(n);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const common = require('../common.js');
|
||||
const { OutgoingMessage } = require('_http_outgoing');
|
||||
const { OutgoingMessage } = require('http');
|
||||
|
||||
const bench = common.createBenchmark(main, {
|
||||
value: [
|
||||
|
||||
Reference in new issue
Block a user