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 width="512" height="512" id="canvas" style="border: 1px dashed black;"></canvas>
<canvas width="512" height="512" id="canvas" style="border: 1px dashed black;"></canvas>
<script>
var classic = new Array(1310720);
var context = document.getElementById("canvas").getContext("2d");
var imageData = context.getImageData(0, 0, 512, 512);
var canvas = imageData.data;
if (typeof Uint8Array !== 'undefined') {
var typed8 = new Uint8Array(1310720);
var typed32 = new Uint32Array(1310720);
}
for (var i = 0; i < 1310720; ++i) {
var number = ~~ (Math.random() * 254)
classic[i] = number;
canvas[i] = number;
if (typeof Uint8Array !== 'undefined') {
typed8[i] = number;
typed32[i] = number;
}
}
context.putImageData(imageData, 0, 0);
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Classic |
| ready |
Canvas |
| ready |
Typed 8 |
| ready |
Typed 32 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.