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=256 height=256 id="canvas"></canvas>
<script type="text/javascript">
var imageURL = "http://jsrun.it/assets/m/t/O/t/mtOtb.png";
var n = 300;
var imageArray = [];
var canvasArray = [];
var ctx = document.getElementById('canvas').getContext('2d');
for (var i = 0; i < n; i++) {
(function(i) {
var img = new Image();
img.onload = function() {
var canvas = document.createElement("canvas");
canvas.width = img.width;
canvas.height = img.height;
canvas.getContext("2d").drawImage(img, 0, 0, canvas.width, canvas.height);
canvasArray[i] = canvas;
};
img.src = imageURL + "?i=" + i;
imageArray[i] = img;
})(i);
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
drawImage using HTMLImageElement |
| ready |
drawImage using HTMLCanvasElement |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.