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="box">
<p class="pclass">
Hi
</p>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js">
</script>
<script>
$(function() {
//add a bunch of other non p elements
var ind = 0;
var iterations = 1000;
var htmls = "";
while (iterations--) {
htmls += "<a href='#' id=x=link-" + ind + "</a>\n";
ind++;
}
$('#box').parent().append(htmls);
console.log('hi')
});
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
1. $('#box p'); |
| ready |
2. $('#box').children('p'); |
| ready |
3. $('#box').find('p'); |
| ready |
4. $('p'); |
| ready |
5. $('#box p.pclass'); |
| ready |
6. $('#box').children('p.pclass'); |
| ready |
7. $('#box').find('p.pclass'); |
| ready |
8. $('p.pclass'); |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.