getImageData Performance

JavaScript performance comparison

Revision 7 of this test case created

Info

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

Preparation code

<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

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
1x1
//getData(1);
pending…
32x32
getData(32);
pending…
64x64
getData(64);
pending…
256x256
getData(256);
pending…
whole image
getData(2880);
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. Here’s a list of current revisions for this page:

0 comments

Add a comment