test (v6)

Revision 6 of this benchmark created on


Preparation HTML

<canvas id="canv" style="background: black;filter: brightness(175%);width: 100%;height: 100%;position: absolute;"></canvas>

Setup

var d = document;
var c;
var ctx;

Test runner

Ready to run.

Testing in
TestOps/sec
Full width
c = d.getElementById('canv');
ctx = c.getContext('2d');
c.width = d.documentElement.clientWidth;
len = 180;
for (i = 0; i < len; i++) {
	ctx.fillStyle = '#4488CC';
    ctx.fillRect(i * c.width / len, 0, c.width, c.height);
}
ready
double width
c = d.getElementById('canv');
ctx = c.getContext('2d');
c.width = d.documentElement.clientWidth;
len = 180;
var w = c.width / len;
for (i = 0; i < len; i++) {
	ctx.fillStyle = '#4488CC';
    ctx.fillRect(i * w, 0, 2 * w, c.height);
}
ready

Revisions

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