{"ScriptPreparationCode":"function SlowMap() {\r\n this._keys = [];\r\n this._values = [];\r\n}\r\n\r\nSlowMap.prototype = {\r\n set: function(key, value) {\r\n const index = this._keys.indexOf(key);\r\n if (index !== -1) {\r\n this._values[index] = value;\r\n } else {\r\n this._keys.push(key);\r\n this._values.push(value);\r\n }\r\n },\r\n \r\n get: function(key) {\r\n const index = this._keys.indexOf(key);\r\n if (index !== -1) {\r\n return this._values[index];\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n};\r\n\r\nvar VALUE_COUNT = 10;\r\nvar VALUES = [];\r\n\r\nvar slowMapByValue = new SlowMap();\r\nvar nativeMapByValue = new Map();\r\nvar nativeMapByString = new Map();\r\nvar objectMapByString = {};\r\n\r\nfunction createStringKey(value) {\r\n // Need to include type info in key to avoid collisions between similar string and number values.\r\n return (typeof value) \u002B value;\r\n}\r\n\r\nfor (let i = 0; i \u003C VALUE_COUNT; \u002B\u002Bi) {\r\n var value = (i % 2) ? i : \u0022value_\u0022 \u002B i;\r\n \r\n VALUES.push(value);\r\n slowMapByValue.set(value, i);\r\n nativeMapByValue.set(value, i);\r\n nativeMapByString.set(createStringKey(value), i);\r\n objectMapByString[createStringKey(value)] = i;\r\n}\r\n\r\nvar testLoopCount = 0;\r\n","TestCases":[{"Name":"Polyfill Map by Value","Code":"const result = slowMapByValue.get(VALUES[testLoopCount\u002B\u002B % VALUE_COUNT]);","IsDeferred":false},{"Name":"Native Map by Value","Code":"const result = nativeMapByValue.get(VALUES[testLoopCount\u002B\u002B % VALUE_COUNT]);","IsDeferred":false},{"Name":"Native Map by String","Code":"const result = nativeMapByString.get(createStringKey(VALUES[testLoopCount\u002B\u002B % VALUE_COUNT]));","IsDeferred":false},{"Name":"Object by String","Code":"const result = objectMapByString[createStringKey(VALUES[testLoopCount\u002B\u002B % VALUE_COUNT])]","IsDeferred":false}]}