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
Test des performances d'affichage de canvas html5.
En mode double layer : un premier canvas affiche une image de fond et un second canvas (affiché au dessus du premier) s'efface puis affiche une petite image.
En mode one layer : un seul canvas s'efface, puis affiche une image de fond et enfin une petite image.
<div style="position: relative; width: 400px; height: 400px">
<canvas id="background" width="400" height="400" style="position:absolute;z-index:0;border: 1px solid #000000;">
</canvas>
<canvas id="foreground" width="400" height="400" style="position:absolute;z-index:1;border: 1px solid #000000;">
</canvas>
</div>
<script>
var bgCtx= document.querySelector('#background').getContext('2d');
var fgCtx= document.querySelector('#foreground').getContext('2d');
var imgBg = new Image();
imgBg.src = 'http://www.faire-des-jeux.com/jsperf/background.jpg';
var imgFg = new Image();
imgFg.src = 'http://www.faire-des-jeux.com/jsperf/module.png';
</script>
fgCtx.clearRect(0,0,400,400);
bgCtx.clearRect(0,0,400,400);
bgCtx.drawImage(imgBg,0,0);
fgCtx.drawImage(imgFg,200,200);
Ready to run.
Test | Ops/sec | |
---|---|---|
one layer canvas |
| ready |
double layer canvas |
| ready |
double layer only one clear |
| ready |
double layer only one clear one draw |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.