getImageData Performance (v7)

Revision 7 of this benchmark created on


Description

Checking to see the performance of getImageData for various widths and heights.

Preparation HTML

<script>
  var canvas = document.createElement('canvas');
  canvas.width = 2880;
  canvas.height = 2880;
  var context = canvas.getContext('2d');
  context.fillStyle = '#abc';
  context.fillRect(0, 0, canvas.width, canvas.height);

  var getData = function(chunkSize){
    for(var y = 0; y < canvas.height; y += chunkSize)
      for(var x = 0; x < canvas.width; x += chunkSize)
        var data = context.getImageData(x, y, chunkSize, chunkSize);
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
1x1
//getData(1);
ready
32x32
getData(32);
ready
64x64
getData(64);
ready
256x256
getData(256);
ready
whole image
getData(2880);
ready

Revisions

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