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
Checking if using the more fully-featured drawImage() methods have a performance cost when no scaling is required.
context.drawImage(img,x,y);
context.drawImage(img,x,y,width,height);
context.drawImage(img,sx,sy,swidth,sheight,x,y,width,height);
<canvas id="screen"></canvas>
<script>
var ctx = document.getElementById("screen").getContext("2d");
var image = document.createElement("img");
var nativeWidth;
var nativeHeight;
image.onload = function() {
nativeWidth = image.width;
nativeHeight = image.height;
};
image.src = "http://icons.iconarchive.com/icons/ph03nyx/super-mario/48/Retro-Mushroom-1UP-2-icon.png";
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
no scaling arguments |
| ready |
destination scaling arguments |
| ready |
source+destination scaling arguments |
| ready |
Actual scaling |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.