{"ScriptPreparationCode":"function randstr(N) {\r\n return (Math.random().toString(36)\u002B\u002700000000000000000\u0027).slice(2, N\u002B2);\r\n}\r\nvar dataset = [];\r\nfor (var x = 0; x \u003C 100000; x\u002B\u002B) {\r\n dataset.push({id: \u0027xx\u0027 \u002B x, name: randstr(10), other: randstr(10)});\r\n}\r\nvar indexedDataset = {};\r\nfor (var item of dataset) {\r\n indexedDataset[item.id] = item;\r\n}\r\nvar indexMap = {};\r\nfor (var [i, item] of dataset.entries()) {\r\n indexMap[item.id] = i;\r\n}\r\nfunction assertEq(a, b) {\r\n if (a !== b) {\r\n new Error(\u0060Failed assert: \u0022${a}\u0022 expected \u0022${b}\u0022\u0060);\r\n }\r\n}","TestCases":[{"Name":"Array.find","Code":"for (var x = 0; x \u003C 10000; \u002B\u002Bx) {\r\n const item = dataset.find(v =\u003E v.id == \u0027xx\u0027 \u002B 123);\r\n assertEq(item.id, \u0027xx\u0027 \u002B 123);\r\n}","IsDeferred":false},{"Name":"indexed copy","Code":"for (var x = 0; x \u003C 10000; \u002B\u002Bx) {\r\n const item = indexedDataset[\u0027xx\u0027 \u002B 123];\r\n assertEq(item.id, \u0027xx\u0027 \u002B 123);\r\n}","IsDeferred":false},{"Name":"index map","Code":"for (var x = 0; x \u003C 10000; \u002B\u002Bx) {\r\n const item = dataset[indexMap[\u0027xx\u0027 \u002B 123]];\r\n assertEq(item.id, \u0027xx\u0027 \u002B 123);\r\n}","IsDeferred":false}]}