MCPcopy Create free account
hub / github.com/nodejs/node / publishWithCheck

Function publishWithCheck

benchmark/diagnostics_channel/publish.js:33–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31 }
32
33 const publishWithCheck = () => {
34 const data = createObj(objSize);
35 bench.start();
36 for (let i = 0; i < n; i++) {
37 if (channel.hasSubscribers) {
38 channel.publish(data);
39 }
40 }
41 bench.end(n);
42 };
43
44 const publishWithoutCheck = () => {
45 const data = createObj(objSize);

Callers 1

mainFunction · 0.85

Calls 4

createObjFunction · 0.70
startMethod · 0.45
publishMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected