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="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div id="a">
<p id="b">
<span id="c">
lorem ipsum
</span>
<strong id="d">
dolor sit amet
</strong>
</p>
</div>
<div id="e">
hello world
</div>
function getId(id) {
return document.getElementById(id);
}
function id$(id) {
var rgx = /,\s*/g;
if ( !! ~id.search(rgx)) {
id = id.split(rgx);
var ids = [],
i = 0,
len = id.length;
while (i < len) {
ids.push(getId(id[i]));
i++
}
return $(ids)
} else {
return $(getId(id))
}
}
Ready to run.
Test | Ops/sec | |
---|---|---|
jQuery (single) |
| ready |
Native with jQuery (single) |
| ready |
jQuery (many) |
| ready |
Native with jQuery (many) |
| ready |
Native QSA |
| ready |
Native getElementById |
| ready |
Native + JQuery |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.