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; }
</style>
<div id="box">
<p>
Shake Me!
</p>
<img src="http://lorempixel.com/400/200/" />
</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 box = document.getElementById('box');
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) {
console.log('TIME OUT fallback');
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.