canvas-clear

JavaScript performance comparison

Revision 39 of this test case created by

Preparation code

<canvas id="c" width="640" height="480"></canvas>
<script>
  var canvas = document.getElementById('c');
  var ctx = canvas.getContext('2d');
</script>
    

Preparation code output

<canvas id="c" width="640" height="480"></canvas>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
clearRect + fillRect + draw
for (var i = 0; i < 100; i++) {
  ctx.clearRect(0, 0, 640, 480);
  ctx.fillStyle = 'black';
  ctx.fillRect(0, 0, 640, 480);
  ctx.fillStyle = 'rgb(255, 255, 255)';
  ctx.fillRect(320, 240, 1, 1);
}
pending…
fillRect + draw
for (var i = 0; i < 100; i++) {
  ctx.fillStyle = 'black';
  ctx.fillRect(0, 0, 640, 480);
  ctx.fillStyle = 'rgb(255, 255, 255)';
  ctx.fillRect(320, 240, 1, 1);
}
pending…

Compare results of other browsers

Revisions

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

0 Comments