{"ScriptPreparationCode":"class CustomArray extends Array {\r\n constructor(...args) {\r\n super(args);\r\n this.position = 0;\r\n }\r\n}\r\n\r\nclass CustomUint8Array extends Uint8Array {\r\n constructor(...args) {\r\n super(args);\r\n this.position = 0;\r\n }\r\n}\r\n\r\nconst LENGTH = 12000;\r\n\r\nvar rArray = [];\r\nvar uint8Array = new Uint8Array(LENGTH);\r\nvar uint8ArrayExp = new Uint8Array(LENGTH);\r\nuint8ArrayExp.position = 0;\r\nvar cArray = new CustomArray(LENGTH);\r\nvar cUint8Array = new CustomUint8Array(LENGTH);\r\n\r\nfor (let i = 0; i \u003C LENGTH; i\u002B\u002B) {\r\n const v = ~~(Math.random() * 255);\r\n rArray.push(v);\r\n uint8Array[i] = v;\r\n uint8ArrayExp[i] = v;\r\n cArray[i] = v;\r\n cUint8Array[i] = v;\r\n}","TestCases":[{"Name":"Regular Array","Code":"function read(arr, offset) {\r\n let pos = offset;\r\n while (pos \u003C arr.length) {\r\n pos\u002B\u002B;\r\n if (arr[pos] \u003C 127) {\r\n return pos;\r\n }\r\n }\r\n return pos;\r\n}\r\n\r\nlet o = 0;\r\nwhile (o \u003C rArray.length) {\r\n o = read(rArray, o);\r\n}","IsDeferred":false},{"Name":"Uint Array","Code":"function read(arr, offset) {\r\n let pos = offset;\r\n while (pos \u003C arr.length) {\r\n pos\u002B\u002B;\r\n if (arr[pos] \u003C 127) {\r\n return pos;\r\n }\r\n }\r\n return pos;\r\n}\r\n\r\nlet o = 0;\r\nwhile (o \u003C uint8Array.length) {\r\n o = read(uint8Array, o);\r\n}","IsDeferred":false},{"Name":"Uint Array Expando","Code":"function read(arr) {\r\n while (arr.position \u003C arr.length) {\r\n arr.position\u002B\u002B;\r\n if (arr[arr.position] \u003C 127) {\r\n return arr.position;\r\n }\r\n }\r\n return arr.position;\r\n}\r\n\r\nlet o = 0;\r\nuint8ArrayExp.position = 0;\r\nwhile (o \u003C uint8ArrayExp.length) {\r\n o = read(uint8ArrayExp);\r\n}","IsDeferred":false},{"Name":"Custom Array","Code":"function read(arr) {\r\n while (arr.position \u003C arr.length) {\r\n arr.position\u002B\u002B;\r\n if (arr[arr.position] \u003C 127) {\r\n return arr.position;\r\n }\r\n }\r\n return arr.position;\r\n}\r\n\r\nlet o = 0;\r\nwhile (o \u003C cArray.length) {\r\n o = read(cArray);\r\n}","IsDeferred":false},{"Name":"Custom Uint Array","Code":"function read(arr) {\r\n while (arr.position \u003C arr.length) {\r\n arr.position\u002B\u002B;\r\n if (arr[arr.position] \u003C 127) {\r\n return arr.position\u002B\u002B;\r\n }\r\n }\r\n return arr.position;\r\n}\r\n\r\nlet o = 0;\r\nwhile (o \u003C cUint8Array.length) {\r\n o = read(cUint8Array, o);\r\n}","IsDeferred":false}]}