jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
Canvas size dependent test for clearing.
function createCanvas(size) {
var c = document.createElement('canvas');
c.width = c.height = size;
document.body.appendChild(c);
var ctx = c.getContext('2d');
ctx.fillStyle = '#100';
ctx.fillRect(0, 0, c.width, c.height);
return c;
}
var c1 = createCanvas(256);
var ctx1 = c1.getContext('2d');
var c2 = createCanvas(512);
var ctx2 = c2.getContext('2d');
var c3 = createCanvas(1024);
var ctx3 = c3.getContext('2d');
var c4 = createCanvas(2048);
var ctx4 = c4.getContext('2d');
Ready to run.
Test | Ops/sec | |
---|---|---|
clearRect 256 |
| ready |
setWidth 256 |
| ready |
clearRect 512 |
| ready |
setWidth 512 |
| ready |
clearRect 1024 |
| ready |
setWidth 1024 |
| ready |
clearRect 2048 |
| ready |
setWidth 2048 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.