canvas-clearRect-size (v7)

Revision 7 of this benchmark created on


Description

clear rect vs width

Preparation HTML

<script>
  var c = document.createElement('canvas');
  c.width = c.height = 256;
document.body.appendChild( c );
  var ctx = c.getContext('2d');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
clearRect
  ctx.clearRect(0, 0, 256,256);
 
ready
clearRect self
ctx.clearRect(0, 0, c.width, c.height);
ready
clearWidth
c.width = 0;
c.width = 256;
ready
clearWidth self
c.width=256
ready
clearWidth previousWidth
c.width=c.width
ready

Revisions

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