Partial Re-rendering (v2)

Revision 2 of this benchmark created by Boris on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
only render differences
for (var i = 0; i < canvas.width; i++) {
  context.fillStyle = 'black';
  context.fillRect(i-1, HEIGHT, 1, 1);
  context.fillStyle = 'white';
  context.fillRect(i, HEIGHT, 1, 1);
}
ready
re-render whole scene
for (var i = 0; i < canvas.width; i++) {
  context.fillStyle = '#000';
  context.fillRect(0, 0, canvas.width, canvas.height);
  context.fillStyle = '#fff';
  context.fillRect(i, HEIGHT, 1, 1);
}
ready

Revisions

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