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
<style>
#box{ position: relative; left: 20px; right: 20px; border: 1px solid red; width:
500px; height: 400px; line-height: 20px; text-align: center; vertical-align: center;
background: red; -webkit-backface-visibility: hidden; -webkit-transform-style: preserve-3d; -webkit-perspective: 500}
</style>
<div id="box">
<p>Shake Me!</p>
<img src="http://lorempixel.com/output/fashion-q-c-420-300-6.jpg"/>
</div>
var ua = navigator.userAgent;
if (ua.match(/Chrome|Safari/))
var styleName= 'webkitTransform';
else if (ua.match(/Firefox/))
var styleName= 'MozTransform';
else if (ua.match(/Opera/))
var styleName= 'OTransform';
else if (ua.match(/MSIE 9/))
var styleName= 'msTransform';
var style = document.getElementById('box').style;
var c=0; var counts=[0,0,0,0,0];
var R=[];var len=100;var w=window.innerWidth; var step=w/len;
var i=0; var y=0;
for (i=0; i<len/2; i++) {
y+=step;
R.push(y);
}
for (; i<len; i++) {
y-=step;
R.push(y);
}
window.requestAnimFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function( callback ){
window.setTimeout(callback, 1000 / 60);
};
})();
Ready to run.
Test | Ops/sec | |
---|---|---|
translate3D |
| ready |
translateXYZ |
| ready |
TranslateXY |
| ready |
Left / Top |
| ready |
Left+Top |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.