{"ScriptPreparationCode":"var count = 6000000;\r\nvar list = new Array(count).fill(100);","TestCases":[{"Name":"slice immutable","Code":"var insertCount = 0;\r\nfor (var i = 0; i \u003C 10; \u002B\u002Bi) {\r\n if (list.length \u003E count - 1) {\r\n list=list.slice(0, count - 1)\r\n list.push(insertCount\u002B\u002B)\r\n } else {\r\n list = [...list, insertCount\u002B\u002B];\r\n }\r\n}\r\nvar foo = list;\r\n","IsDeferred":false},{"Name":"splice immutable","Code":"var insertCount = 0;\r\nfor (var i = 0; i \u003C 10; \u002B\u002Bi) {\r\n list = [...list, insertCount\u002B\u002B]\r\n\r\n if (list.length \u003E count) {\r\n list.splice(0, list.length - count);\r\n }\r\n}\r\nvar foo = list;","IsDeferred":false},{"Name":"shift-while immutable","Code":"var insertCount = 0;\r\nfor (var i = 0; i \u003C 10; \u002B\u002Bi) {\r\n list = [...list, insertCount\u002B\u002B]\r\n while (list.length \u003E count) {\r\n list.shift();\r\n }\r\n}\r\nvar foo = list;","IsDeferred":false},{"Name":"slice mutable","Code":"var insertCount = 0;\r\nfor (var i = 0; i \u003C 10; \u002B\u002Bi) {\r\n list=list.slice(0, count)\r\n list.push(insertCount\u002B\u002B)\r\n}\r\nvar foo = list;","IsDeferred":false},{"Name":"splice mutable","Code":"var insertCount = 0;\r\nfor (var i = 0; i \u003C 10; \u002B\u002Bi) {\r\n list.push(insertCount\u002B\u002B)\r\n if (list.length \u003E count) {\r\n list.splice(0, list.length - count);\r\n }\r\n}\r\nvar foo = list;","IsDeferred":false},{"Name":"shift-while mutable","Code":"var insertCount = 0;\r\nfor (var i = 0; i \u003C 10; \u002B\u002Bi) {\r\n list.push(insertCount\u002B\u002B)\r\n while (list.length \u003E count) {\r\n list.shift();\r\n }\r\n}\r\nvar foo = list;","IsDeferred":false},{"Name":"circular buffer","Code":"var idx = 0;\r\nvar insertCount = 0;\r\nfor (var i = 0; i \u003C 10; \u002B\u002Bi) {\r\n list[idx] = insertCount\u002B\u002B;\r\n idx = (idx \u002B 1) % count;\r\n}\r\nvar foo = [...list.slice(idx), ...list.slice(0, idx)];","IsDeferred":false}]}