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
<script>
var numFrames = 20;
var sWidth = 64;
var sHeight = 64;
var c = document.createElement('canvas');
c.height = sHeight;
c.width = sWidth * numFrames;
var ctx = c.getContext('2d');
ctx.fillRect(0, 0, c.width, c.height);
var c2 = document.createElement('canvas');
c2.width = 512;
c2.height = 512;
var ctx2 = c2.getContext('2d');
var frames = [];
var index = 0;
for (var i = 0; i < numFrames; i++) {
var f = document.createElement('canvas');
f.width = sWidth;
f.height = sHeight;
var fctx = f.getContext('2d');
fctx.globalCompositeOperation = 'copy';
fctx.drawImage(c, 0, 0, sWidth, sHeight, index, 0, sWidth, sHeight);
frames.push(f);
index += sWidth;
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
clipping |
| ready |
cached frames |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.