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

Function run

benchmark/blob/file.js:15–30  ·  view source on GitHub ↗
(n, bytes, operation)

Source from the content-addressed store, hash-verified

13};
14
15async function run(n, bytes, operation) {
16 const buff = Buffer.allocUnsafe(bytes);
17 const source = new File(buff, 'dummy.txt', options);
18 bench.start();
19 for (let i = 0; i < n; i++) {
20 switch (operation) {
21 case 'text':
22 await source.text();
23 break;
24 case 'arrayBuffer':
25 await source.arrayBuffer();
26 break;
27 }
28 }
29 bench.end(n);
30}
31
32function main(conf) {
33 run(conf.n, conf.bytes, conf.operation).catch(console.log);

Callers 1

mainFunction · 0.70

Calls 4

textMethod · 0.65
arrayBufferMethod · 0.65
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected