clearRect vs. fillRect (v5)

Revision 5 of this benchmark created on


Preparation HTML

<canvas id="canvas" width="10" height="10"></canvas>
<script>
  var ctx = document.getElementById("canvas").getContext("2d");
  ctx.fillStyle = "#000000";
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
clearRect
ctx.clearRect(0, 0, 10, 10);
ready
fillRect
ctx.fillRect(0, 0, 10, 10);
ready
rect with fill
ctx.beginPath();
ctx.rect(0,0,10,10);
ctx.fill();
ready

Revisions

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