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

Function run

benchmark/blob/blob.js:11–26  ·  view source on GitHub ↗
(n, bytes, operation)

Source from the content-addressed store, hash-verified

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

Callers 2

mainFunction · 0.70
mainFunction · 0.50

Calls 4

textMethod · 0.95
arrayBufferMethod · 0.95
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected