Canvas getImageData

JavaScript performance comparison

Revision 8 of this test case created by

Preparation code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
      
<script>
Benchmark.prototype.setup = function() {
  var canvas = document.createElement("canvas")
  canvas.width = 2048
  canvas.height = 2048
  var ctx = canvas.getContext("2d")
  ctx.fillRect(0, 0, 2048, 10)

};
</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
data = ctx.getImageData(0, 0, 2048, 2048)
pending…
multiple tiles
var data = []
for (var x = 0; x < 64; x++) {
  data.push(canvas.getContext("2d").getImageData(x * 8, (x % 8) * 8, 256, 256));
}
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