(method, n, values, values2)
| 19 | }); |
| 20 | |
| 21 | function 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 | |
| 33 | function main({ n, len, method, strict }) { |
| 34 | const array = Array.from({ length: len }, () => ''); |