test

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('canvas');
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('canvas');
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, 2*c.width / len, c.height);
}
ready

Revisions

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