mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
benchmark: reduce N for diagnostics_channel subscribe benchmark
Signed-off-by: artimmy <arthurtimmy@hotmail.com> PR-URL: https://github.com/nodejs/node/pull/59116 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
@@ -3,17 +3,16 @@ const common = require('../common.js');
|
||||
const dc = require('diagnostics_channel');
|
||||
|
||||
const bench = common.createBenchmark(main, {
|
||||
n: [1e8],
|
||||
n: [1e5],
|
||||
});
|
||||
|
||||
function noop() {}
|
||||
function noop() { }
|
||||
|
||||
function main({ n }) {
|
||||
const channel = dc.channel('channel.0');
|
||||
|
||||
bench.start();
|
||||
for (let i = 0; i < n; i++) {
|
||||
channel.subscribe(noop);
|
||||
dc.subscribe('channel.0', noop);
|
||||
}
|
||||
bench.end(n);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user