Skip to content

Commit f0d87a4

Browse files
committed
benchmark: add diagnostics_channel subscribe benchmark
Signed-off-by: artimmy <[email protected]>
1 parent edd66d0 commit f0d87a4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

benchmark/diagnostics_channel/subscribe.js

Lines changed: 3 additions & 4 deletions
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
}

0 commit comments

Comments
 (0)