{"ScriptPreparationCode":null,"TestCases":[{"Name":"Array find","Code":"const positions = Array.from({ length: 10_000 }, () =\u003E [Math.random(), Math.random()]);\r\nconst existing = [];\r\nlet counter = 0;\r\nfor (const p of positions) {\r\n\texisting.push([p[0], [1]]);\r\n}\r\n\r\nfor (const p of positions) {\r\n\tconst exists = existing.find((e) =\u003E e[0] === [0] \u0026\u0026 e[1] === p[1]);\r\n}","IsDeferred":false},{"Name":"Array indexOf","Code":"const positions = Array.from({ length: 10_000 }, () =\u003E [Math.random(), Math.random()]);\r\nconst existing = [];\r\nlet counter = 0;\r\nfor (const p of positions) {\r\n\texisting.push(\u0060${p[0]}-${p[1]}\u0060);\r\n}\r\n\r\nfor (const p of positions) {\r\n\tconst exists = existing.indexOf(\u0060${p[0]}-${p[1]}\u0060) \u003E -1;\r\n\tif (exists) {\r\n\t\tcounter\u002B\u002B;\r\n\t}\r\n}","IsDeferred":false},{"Name":"Map has","Code":"const positions = Array.from({ length: 10_000 }, () =\u003E [Math.random(), Math.random()]);\r\nconst existing = new Map();\r\nlet counter = 0;\r\nfor (const p of positions) {\r\n\texisting.set(\u0060${p[0]}-${p[1]}\u0060, true);\r\n}\r\n\r\nfor (const p of positions) {\r\n\tconst exists = existing.has(\u0060${p[0]}-${p[1]}\u0060);\r\n\tif (exists) {\r\n\t\tcounter\u002B\u002B;\r\n\t}\r\n}","IsDeferred":false},{"Name":"Map get","Code":"const positions = Array.from({ length: 10_000 }, () =\u003E [Math.random(), Math.random()]);\r\nconst existing = new Map();\r\nlet counter = 0;\r\nfor (const p of positions) {\r\n\texisting.set(\u0060${p[0]}-${p[1]}\u0060, true);\r\n}\r\n\r\nfor (const p of positions) {\r\n\tconst exists = existing.get(\u0060${p[0]}-${p[1]}\u0060) === true;\r\n\tif (exists) {\r\n\t\tcounter\u002B\u002B;\r\n\t}\r\n}","IsDeferred":false},{"Name":"Set has","Code":"const positions = Array.from({ length: 10_000 }, () =\u003E [Math.random(), Math.random()]);\r\nconst existing = new Set();\r\nlet counter = 0;\r\nfor (const p of positions) {\r\n\texisting.add(\u0060${p[0]}-${p[1]}\u0060, true);\r\n}\r\n\r\nfor (const p of positions) {\r\n\tconst exists = existing.has(\u0060${p[0]}-${p[1]}\u0060);\r\n\tif (exists) {\r\n\t\tcounter\u002B\u002B;\r\n\t}\r\n}","IsDeferred":false}]}