Canvas getImageData

JavaScript performance comparison

Revision 7 of this test case created by

Preparation code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
    

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
one tile
var canvas = document.createElement("canvas")
canvas.width = 2000
canvas.height = 2000
var ctx = canvas.getContext("2d")
data = ctx.getImageData(0, 0, 2000, 2000)
pending…
multiple tiles
var data = []
for (var x = 0; x < 64; x++) {
  var canvas = document.createElement("canvas");
  canvas.width = 256;
  canvas.height = 256;
  data.push(canvas.getContext("2d").getImageData(0, 0, 256, 256));
  delete canvas;
}
pending…
larger tiles
var data = []
for (var x = 0; x < 16; x++) {
  var canvas = document.createElement("canvas");
  canvas.width = 512;
  canvas.height = 512;
  data.push(canvas.getContext("2d").getImageData(0, 0, 512, 512));
  delete canvas;
}
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