Canvas getImageData

JavaScript performance comparison

Revision 2 of this test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var canvas512 = document.createElement("canvas");
    canvas512.width = canvas512.height = 512;
    var ctx512 = canvas512.getContext("2d", { willReadFrequently: true });
   
    var canvas1024 = document.createElement("canvas");
    canvas1024.width = canvas1024.height = 1024;
    var ctx1024 = canvas1024.getContext("2d", { willReadFrequently: true });
   
    var canvas2048 = document.createElement("canvas");
    canvas2048.width = canvas2048.height = 2048;
    var ctx2048 = canvas2048.getContext("2d", { willReadFrequently: true });
   
    var canvas4096 = document.createElement("canvas");
    canvas4096.width = canvas4096.height = 4096;
    var ctx4096 = canvas4096.getContext("2d", { willReadFrequently: true });
};
</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
ctx512
var image = ctx512.getImageData(0, 0, 100, 100);
ctx512.putImageData(image, 0, 0);
 
pending…
ctx1024
var image = ctx1024.getImageData(0, 0, 100, 100);
ctx1024.putImageData(image, 0, 0);
 
pending…
ctx2048
var image = ctx2048.getImageData(0, 0, 100, 100);
ctx2048.putImageData(image, 0, 0);
 
pending…
ctx4096
var image = ctx4096.getImageData(0, 0, 100, 100);
ctx4096.putImageData(image, 0, 0);
 
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