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
How does the source of drawImage affect performance?
<canvas id="drawCanvas"></canvas>
<canvas id="sourceCanvas" style="display:hidden"></canvas>
<script>
var sourceCanvas = document.getElementById("sourceCanvas");
var sourceCtx = sourceCanvas.getContext("2d");
var drawCanvas = document.getElementById("drawCanvas");
var drawCtx = drawCanvas.getContext("2d");
var image = document.createElement("img");
image.src = "http://icons.iconarchive.com/icons/ph03nyx/super-mario/48/Retro-Mushroom-1UP-2-icon.png";
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
CanvasImageSource : HTMLImageElement |
| ready |
CanvasImageSource : HTMLCanvasElement |
| ready |
CanvasImageSource : CanvasRenderingContext2D |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.