fillRect area comparison

JavaScript performance comparison

Test case created by Greg

Preparation code

<canvas id="cvs" width="1024" height="1024"></canvas>
<script>
Benchmark.prototype.setup = function() {
    var cvs = document.getElementById("cvs");
    var ctx = cvs.getContext("2d");
};
</script>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
fill rect (1024x1024)
ctx.fillStyle = "#000";
for(var i=0; i<1000; ++i)
ctx.fillRect(0, 0, 1024, 1024);
pending…
fill rect (256x256)
ctx.fillStyle = "#000";
for(var i=0; i<1000; ++i)
ctx.fillRect(0, 0, 256, 256);
pending…
fill rect (64x64)
ctx.fillStyle = "#000";
for(var i=0; i<1000; ++i)
ctx.fillRect(0, 0, 64, 64);
pending…
fill rect (16x16)
ctx.fillStyle = "#000";
for(var i=0; i<1000; ++i)
ctx.fillRect(0, 0, 16, 16);
pending…

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

Compare results of other browsers

0 comments

Add a comment