{"ScriptPreparationCode":"function getRandomInt(max) {\r\n return Math.floor(Math.random() * Math.floor(max));\r\n}\r\n\r\nvar arr = [];\r\nfor(var i = 0; i \u003C 100000; i\u002B\u002B){\r\n arr.push({timestamp:getRandomInt(100), nanos:getRandomInt(100)});\r\n}\r\n","TestCases":[{"Name":"Lodash sortBy","Code":"_.sortBy(arr, [\u0027timestamp\u0027, \u0027nanos\u0027])","IsDeferred":false},{"Name":"Stable Sort","Code":"const stableSort = (data) =\u003E data\r\n .map((item, index) =\u003E ({ item, index }))\r\n .sort(\r\n (a, b) =\u003E\r\n a.item.timestamp - b.item.timestamp || a.item.nanos - b.item.nanos || a.index - b.index,\r\n )\r\n .map(({ item }) =\u003E item);\r\n\r\nstableSort(arr)","IsDeferred":false}]}