canvasclear (v20)

Revision 20 of this benchmark created on


Preparation HTML

<canvas id="canvas1" width="500" height="500"></canvas>
<script>
  var can = document.getElementById('canvas1');
  var ctx = can.getContext('2d');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
setting width
ctx.fillStyle = "black";
ctx.fillRect(0,0,can.width,can.height);
ready
clearing non-transformed canvas
ctx.clearRect(0, 0, can.width, can.height);
ready
clearing transformed canvas
// I have lots of transforms right now
ctx.save();
ctx.setTransform(1, 0, 0, 1, 0, 0);
// Will always clear the right space
ctx.clearRect(0, 0, can.width, can.height);
ctx.restore();
// Still have my old transforms
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.