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
source images:<br/>
<canvas id="sourceBig" width="361" height="361"></canvas>
<canvas id="sourceSmall" width="100" height="100"></canvas>
<br/><br/>destination canvas:<br/>
<canvas id="drawHere" width="190" height="190"></canvas>
<script>
var sourceBigCanvas = document.getElementById('sourceBig');
var sourceBigCtx = sourceBigCanvas.getContext('2d');
sourceBigCtx.beginPath();
sourceBigCtx.moveTo(0,361);
sourceBigCtx.lineTo(361,0);
sourceBigCtx.lineTo(361,361);
sourceBigCtx.fillStyle = "red";
sourceBigCtx.fill();
var sourceSmallCanvas = document.getElementById('sourceSmall');
var sourceSmallCtx = sourceSmallCanvas.getContext('2d');
sourceSmallCtx.beginPath();
sourceSmallCtx.moveTo(0,100);
sourceSmallCtx.lineTo(100,0);
sourceSmallCtx.lineTo(100,100);
sourceSmallCtx.fillStyle = "red";
sourceSmallCtx.fill();
var drawCanvas = document.getElementById('drawHere');
var drawCtx = drawCanvas.getContext('2d');
function drawGrown(){
drawCtx.save();
drawCtx.scale(1.9,1.9);
drawCtx.drawImage(sourceSmallCanvas,0,0);
drawCtx.restore();
}
function drawShrunk(){
drawCtx.save();
drawCtx.scale(1/1.9,1/1.9);
drawCtx.drawImage(sourceBigCanvas,0,0);
drawCtx.restore();
}
</script>
drawCtx.clearRect(0,0,190,190);
Ready to run.
Test | Ops/sec | |
---|---|---|
draw grown |
| ready |
draw shrunk |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.