blob: d19a6fb43441ce424c40bbb66b0c22274d164e51 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
'use strict';
const common = require('../common.js');
const ClientRequest = require('http').ClientRequest;
const bench = common.createBenchmark(main, {
len: [1, 8, 16, 32, 64, 128],
n: [1e6]
});
function main(conf) {
const len = +conf.len;
const n = +conf.n;
const path = '/'.repeat(len);
const opts = { path: path, createConnection: function() {} };
bench.start();
for (var i = 0; i < n; i++) {
new ClientRequest(opts);
}
bench.end(n);
}
|