{"ScriptPreparationCode":"function shuffleArray(array) {\r\n for (let i = array.length - 1; i \u003E 0; i--) {\r\n const j = Math.floor(Math.random() * (i \u002B 1));\r\n [array[i], array[j]] = [array[j], array[i]];\r\n }\r\n}\r\n\r\n// 31 bit \u002Bve integer smi\r\nvar randSmi = () =\u003E crypto.getRandomValues(new Uint32Array(1))[0] \u0026 0x7fffffff;\r\n// 6-7 char alphanumeric string\r\nvar randStr = () =\u003E randSmi().toString(36);\r\n\r\nvar numEntries = 64;\r\nvar numRounds = 100 * numEntries;\r\n\r\nvar strObj = {};\r\nvar strObjKeys = Array(numEntries);\r\nvar numObj = {};\r\nvar numObjKeys = Array(numEntries);\r\n\r\nvar strSeqObj = {};\r\nvar strSeqObjKeys = Array(numEntries);\r\nvar numSeqObj = {};\r\nvar numSeqObjKeys = Array(numEntries);\r\n\r\nfor (let i = 0; i \u003C numEntries; i\u002B\u002B) {\r\nlet strKey = \u0060k${randStr()}\u0060, numKey = randSmi();\r\nlet strSeqKey = \u0060k${i}\u0060, numSeqKey = i;\r\n\tstrObj[strKey] = i;\r\n\tstrObjKeys[i] = strKey;\r\n\tnumObj[numKey] = i;\r\n\tnumObjKeys[i] = numKey;\r\n\r\n\tstrSeqObj[strSeqKey] = i;\r\n\tstrSeqObjKeys[i] = strSeqKey;\r\n\tnumSeqObj[numSeqKey] = i;\r\n\tnumSeqObjKeys[i] = numSeqKey;\r\n}\r\n\r\nObject.freeze(strObj);\r\nObject.freeze(numObj);\r\nObject.freeze(strSeqObj);\r\nObject.freeze(numSeqObj);\r\n\r\nvar strMap = new Map(Object.entries(strObj));\r\nvar numMap = new Map(Object.entries(numObj));\r\nvar strSeqMap = new Map(Object.entries(strSeqObj));\r\nvar numSeqMap = new Map(Object.entries(numSeqObj));","TestCases":[{"Name":"Object random string keys","Code":"let total = 0;\r\nfor (let i = 0; i \u003C numRounds; i\u002B\u002B) {\r\n total \u002B= strObj[strObjKeys[Math.random() * numEntries | 0]];\r\n}","IsDeferred":false},{"Name":"Object random numeric smi keys","Code":"let total = 0;\r\nfor (let i = 0; i \u003C numRounds; i\u002B\u002B) {\r\n total \u002B= numObj[numObjKeys[Math.random() * numEntries | 0]];\r\n}","IsDeferred":false},{"Name":"Object sequential string keys","Code":"let total = 0;\r\nfor (let i = 0; i \u003C numRounds; i\u002B\u002B) {\r\n total \u002B= strSeqObj[strSeqObjKeys[Math.random() * numEntries | 0]];\r\n}","IsDeferred":false},{"Name":"Object sequential numeric smi keys","Code":"let total = 0;\r\nfor (let i = 0; i \u003C numRounds; i\u002B\u002B) {\r\n total \u002B= numSeqObj[numSeqObjKeys[Math.random() * numEntries | 0]];\r\n}","IsDeferred":false},{"Name":"Map random string keys","Code":"let total = 0;\r\nfor (let i = 0; i \u003C numRounds; i\u002B\u002B) {\r\n total \u002B= strMap.get(strObjKeys[Math.random() * numEntries | 0]);\r\n}","IsDeferred":false},{"Name":"Map random numeric smi keys","Code":"let total = 0;\r\nfor (let i = 0; i \u003C numRounds; i\u002B\u002B) {\r\n total \u002B= numMap.get(numObjKeys[Math.random() * numEntries | 0]);\r\n}","IsDeferred":false},{"Name":"Map sequential string keys","Code":"let total = 0;\r\nfor (let i = 0; i \u003C numRounds; i\u002B\u002B) {\r\n total \u002B= strSeqMap.get(strSeqObjKeys[Math.random() * numEntries | 0]);\r\n}","IsDeferred":false},{"Name":"Map sequential numeric smi keys","Code":"let total = 0;\r\nfor (let i = 0; i \u003C numRounds; i\u002B\u002B) {\r\n total \u002B= numSeqMap.get(numSeqObjKeys[Math.random() * numEntries | 0]);\r\n}","IsDeferred":false}]}