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 differents ways to set styles on various elements
<style>
.test div {
transform:rotateX(30deg);
}
</style>
<div class="test">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
var style = {
border: '1px solid red',
background: '#' + (~~(Math.random() * (1 << 24))).toString(16)
};
function getStyle() {
return 'border:1px solid red;background: #' + (~~(Math.random() * (1 << 24))).toString(16);
}
var targets = document.querySelectorAll('.test div');
Ready to run.
Test | Ops/sec | |
---|---|---|
style attribute |
| ready |
jquery.css |
| ready |
style.cssText |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.