{"ScriptPreparationCode":"$c = document.getElementById(\u0027c\u0027);\r\n$ctx = $c.getContext(\u00272d\u0027);\r\n$ctx.clearRect(0, 0, 5000, 5000);\r\n$px = $ctx.createImageData(1, 1);\r\n$pxls = [];\r\nfor (var i=0; i\u003C10000; \u002B\u002Bi) $pxls.push({\r\n x: Math.random() * 5000 \u003C\u003C 0,\r\n y: Math.random() * 5000 \u003C\u003C 0,\r\n r: Math.random() * 255 \u003C\u003C 0,\r\n g: Math.random() * 255 \u003C\u003C 0,\r\n b: Math.random() * 255 \u003C\u003C 0,\r\n a: Math.random() * 128 \u003C\u003C 0 \u002B 128\r\n});\r\n$i = 0;","TestCases":[{"Name":"fillRect","Code":"for (var i=500;i--;){\r\nvar px = $pxls[$i\u002B\u002B % 10000];\r\n$ctx.fillStyle = \u0027rgba(\u0027 \u002B px.r \u002B \u0027,\u0027 \u002B px.g \u002B \u0027,\u0027 \u002B px.b \u002B \u0027,\u0027 \u002B (px.a / 255) \u002B \u0027)\u0027;\r\n$ctx.fillRect(px.x, px.y, 1, 1);\r\n}","IsDeferred":false},{"Name":"putImage","Code":"var image = $ctx.createImageData($c.width, $c.height);\r\nfor (var i=500;i--;){\r\nvar px=$pxls[$i\u002B\u002B % 10000], d=$px.data;\r\nvar _pidx = i * 4;\r\nimage.data[_pidx] = px.r;\r\nimage.data[_pidx\u002B1] = px.g;\r\nimage.data[_pidx\u002B2] = px.b;\r\nimage.data[_pidx\u002B3] = px.a;\r\n}\r\n$ctx.putImageData(image, 0, 0);","IsDeferred":false}]}