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
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script>
$(function() {
function addStyle(css) {
var head = document.getElementsByTagName('head')[0],
style = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet) style.styleSheet.cssText = css;
else style.appendChild(document.createTextNode(css));
head.appendChild(style);
}
var _css = 'body{margin:0;}' + '*{' + ' -webkit-box-sizing: border-box;' + ' -moz-box-sizing: border-box;' + ' box-sizing: border-box;' + '}' + '.relative{' + ' width: 400px;' + ' height: 400px;' + ' position: relative;' + ' background-color:green;' + '}' + '.absolute{' + ' position: absolute;' + ' top:40px;' + ' left: 20px;' + ' background-color: red;' + ' padding: 30px;' + ' overflow:hidden;' + '}' + '.inner{' + ' margin: 20px;' + ' padding: 10px;' + ' border: 5px solid gray;' + ' background-color: yellow;' + '}';
addStyle(_css);
});
</script>
<div class="wrapper">
<div class="relative">
<div class="absolute">
<div class="inner">
inner
</div>
</div>
</div>
</div>
var $innerBox = $('.inner');
Ready to run.
Test | Ops/sec | |
---|---|---|
getBoundingClientRect |
| ready |
jQuery |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.