{"ScriptPreparationCode":"function getRandomElement(id) {\r\n return {\r\n id,\r\n a: Math.random(),\r\n b: Math.random(),\r\n c: Math.random(),\r\n }\r\n}\r\n\r\nfunction getArray(length) {\r\n const result = [];\r\n for (let i = 0; i \u003C length; i\u002B\u002B) {\r\n result.push(getRandomElement(i))\r\n }\r\n \r\n return result;\r\n}\r\n\r\nfunction arrayToMap(array) {\r\n return new Map(array.map(el =\u003E [el.id, el]));\r\n}\r\n\r\nfunction getRandomInt(max) {\r\n return Math.floor(Math.random() * max);\r\n}\r\n\r\narray_small = getArray(100);\r\narray_large = getArray(1000000);\r\n\r\nmap_small = arrayToMap(array_small);\r\nmap_large = arrayToMap(array_large);","TestCases":[{"Name":"Array.find, 10 000 elements","Code":"const target = getRandomInt(99);\r\nfor (let i = 0; i \u003C 100; i\u002B\u002B) {\r\n\tarray_small.find(el =\u003E el.id === target);\r\n}","IsDeferred":false},{"Name":"Map.get, 10 000 elements","Code":"map_small = arrayToMap(array_small);\r\nfor (let i = 0; i \u003C 100; i\u002B\u002B) {\r\n const target = getRandomInt(99);\r\n map_small.get(target);\r\n}","IsDeferred":false}]}