• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3const common = require('../common.js');
4const { OutgoingMessage } = require('_http_outgoing');
5
6const bench = common.createBenchmark(main, {
7  value: [
8    'X-Powered-By',
9    'Vary',
10    'Set-Cookie',
11    'Content-Type',
12    'Content-Length',
13    'Connection',
14    'Transfer-Encoding',
15  ],
16  n: [1e6],
17});
18
19function main({ n, value }) {
20  const og = new OutgoingMessage();
21
22  bench.start();
23  for (let i = 0; i < n; i++) {
24    og.setHeader(value, '');
25  }
26  bench.end(n);
27}
28