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

Function benchmark

benchmark/assert/deepequal-map.js:21–31  ·  view source on GitHub ↗
(method, n, values, values2)

Source from the content-addressed store, hash-verified

19});
20
21function benchmark(method, n, values, values2) {
22 const actual = new Map(values);
23 // Prevent reference equal elements
24 const deepCopy = JSON.parse(JSON.stringify(values2 ? values2 : values));
25 const expected = new Map(deepCopy);
26 bench.start();
27 for (let i = 0; i < n; ++i) {
28 method(actual, expected);
29 }
30 bench.end(n);
31}
32
33function main({ n, len, method, strict }) {
34 const array = Array.from({ length: len }, () => '');

Callers 1

mainFunction · 0.70

Calls 4

parseMethod · 0.65
methodFunction · 0.50
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…