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
In some cases, my algorithm could use with jQuery.height() or jQuery.offset().top to perform its function, so I would like to use whichever is faster.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://raw.github.com/dreamerslab/jquery.actual/master/jquery.actual.min.js"></script>
<div id="item" style="background-color: #ccc; width: 100px; height: 100px; top: 100px; left: 100px;"><p>Text here...</p></div>
var $item = $("#item");
delete $item; // Unneeded, but sometimes it just feels good :)
Ready to run.
Test | Ops/sec | |
---|---|---|
.offset().top |
| ready |
.height() |
| ready |
.actual("offset").top |
| ready |
.actual("height") |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.