MCPcopy Index your code
hub / github.com/nodejs/node / benchWebStream

Function benchWebStream

benchmark/fs/bench-filehandle-pull-vs-webstream.js:109–118  ·  view source on GitHub ↗
(n, filesize)

Source from the content-addressed store, hash-verified

107// WebStream path: readableWebStream -> TransformStream (upper) -> CompressionStream
108// ---------------------------------------------------------------------------
109async function benchWebStream(n, filesize) {
110 await runWebStream();
111
112 bench.start();
113 let totalBytes = 0;
114 for (let i = 0; i < n; i++) {
115 totalBytes += await runWebStream();
116 }
117 bench.end(totalBytes / (1024 * 1024));
118}
119
120async function runWebStream() {
121 const fh = await fs.promises.open(filename, 'r');

Callers 1

mainFunction · 0.70

Calls 3

runWebStreamFunction · 0.85
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…