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

Function main

benchmark/url/url-searchparams-inspect.js:19–39  ·  view source on GitHub ↗
({ variant, kind, n })

Source from the content-addressed store, hash-verified

17}
18
19function main({ variant, kind, n }) {
20 const sizes = { empty: 0, small: 3, medium: 16, large: 128 };
21 const size = sizes[variant];
22 const params = makeParams(size);
23 let target;
24 if (kind === 'params') {
25 target = params;
26 } else if (kind === 'iterator-keys') {
27 target = params.keys();
28 } else if (kind === 'iterator-values') {
29 target = params.values();
30 } else {
31 target = params.entries();
32 }
33
34 bench.start();
35 for (let i = 0; i < n; i++) {
36 inspect(target, { showHidden: false, depth: 2 });
37 }
38 bench.end(n);
39}

Callers

nothing calls this directly

Calls 7

makeParamsFunction · 0.85
keysMethod · 0.65
inspectFunction · 0.50
valuesMethod · 0.45
entriesMethod · 0.45
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected