benchmark: reduce N for diagnostics_channel subscribe benchmark · nodejs/node@7fc3143

File tree

1 file changed

lines changed

  • benchmark/diagnostics_channel

1 file changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -3,17 +3,16 @@ const common = require('../common.js');

33

const dc = require('diagnostics_channel');

44
55

const bench = common.createBenchmark(main, {

6-

n: [1e8],

6+

n: [1e5],

77

});

88
9-

function noop() {}

9+

function noop() { }

1010
1111

function main({ n }) {

12-

const channel = dc.channel('channel.0');

1312
1413

bench.start();

1514

for (let i = 0; i < n; i++) {

16-

channel.subscribe(noop);

15+

dc.subscribe('channel.0', noop);

1716

}

1817

bench.end(n);

1918

}