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
<div id="one">
<div id="two">
<div id="three">
</div>
</div>
</div>
<style>
#one
{
position: absolute;
top: 20px;
height: 40px;
overflow: scroll;
}
#two
{
position: relative;
top: 100px;
height: 1500px;
}
</style>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.7.1.js'></script>
var one = document.getElementById( 'one' ),
two = document.getElementById( 'two' ),
three = document.getElementById( 'three' ),
$one = $( '#one' ),
$two = $( '#two' ),
$three = $( '#three' );
Element.prototype.positionTop = function () {
return this.offsetLeft - this.parentNode.scrollLeft;
};
Ready to run.
Test | Ops/sec | |
---|---|---|
jQuery .position().top |
| ready |
custom .positionTop |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.