clearRect vs. fillRect

Benchmark created on


Preparation HTML

<canvas id="canvas" width="1000" height="1000"></canvas>
<script>
  var ctx = document.getElementById('canvas').getContext("2d");
  ctx.fillStyle = "rgb(255,255,255)";
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
clearRect
ctx.clearRect(0, 0, 1000, 1000);
ready
fillRect
ctx.fillRect(0, 0, 1000, 1000);
ready

Revisions

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