{"ScriptPreparationCode":"const testObj1 = {};\r\nconst testObj2 = {};\r\nfor (let i = 0; i \u003C 1000; i\u002B\u002B) {\r\n testObj1[\u0060key_${Math.random().toString(36).substring(7)}\u0060] = Math.random();\r\n testObj2[\u0060key_${Math.random().toString(36).substring(7)}\u0060] = Math.random();\r\n}\r\n\r\nfunction keySortedForEach(obj) {\r\n const sortedKeys = Object.keys(obj).sort();\r\n const sortedObj = {};\r\n sortedKeys.forEach(key =\u003E {\r\n sortedObj[key] = obj[key];\r\n });\r\n return sortedObj;\r\n}\r\n\r\nfunction keySortedFromEntries(obj) {\r\n return Object.fromEntries(\r\n Object.entries(obj).sort(([keyA], [keyB]) =\u003E keyA.localeCompare(keyB))\r\n );\r\n}","TestCases":[{"Name":"forEach","Code":"// Benchmark 1\r\nkeySortedForEach(testObj1);","IsDeferred":false},{"Name":"Object.fromEntries","Code":"// Benchmark 2\r\nkeySortedFromEntries(testObj2);","IsDeferred":false}]}