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
what about selecting on other attributes? Last version was broken
<div id="container1">
<ul>
<li>
1
</li>
<li class="target2">
2
</li>
<li class="target" id="target" an_attribute="target">
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li id="foo">
3
</li>
<li>
1
</li>
<li id="one-two-three">
3
</li>
<li id="targetid22">
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
</ul>
</div>
<div id="container1">
<ul>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li id="foo">
3
</li>
<li>
1
</li>
<li id="one-two-three">
3
</li>
<li id="targetid22">
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
</ul>
</div>
<div id="container1">
<ul>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li id="foo">
3
</li>
<li>
1
</li>
<li id="one-two-three">
3
</li>
<li id="targetid22">
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
</ul>
</div>
<div id="container1">
<ul>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li id="foo">
3
</li>
<li>
1
</li>
<li id="one-two-three">
3
</li>
<li id="targetid22">
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
</ul>
</div>
<div id="container">
<ul>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li id="foo">
3
</li>
<li>
1
</li>
<li id="targetid" class="target">
2
</li>
<li id="one-two-three">
3
</li>
<li id="targetid22">
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
</ul>
</div><div id="container1">
<ul>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li id="foo">
3
</li>
<li>
1
</li>
<li id="one-two-three">
3
</li>
<li id="targetid22">
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
</ul>
</div>
<div id="container1">
<ul>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li id="foo">
3
</li>
<li>
1
</li>
<li id="one-two-three">
3
</li>
<li id="targetid22">
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
</ul>
</div>
<div id="container1">
<ul>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li id="foo">
3
</li>
<li>
1
</li>
<li id="one-two-three">
3
</li>
<li id="targetid22">
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
</ul>
</div>
<div id="container1">
<ul>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li id="foo">
3
</li>
<li>
1
</li>
<li id="one-two-three">
3
</li>
<li id="targetid22">
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
1
</li>
<li class="target2">
2
</li>
<li>
3
</li>
</ul>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
$('.target') |
| ready |
$('#target') |
| ready |
$('.target [an_attribute="target"]') |
| ready |
$('#target [an_attribute="target"]') |
| ready |
$('#container1 [an_attribute="target"]') |
| ready |
getElementById |
| ready |
$('[an_attribute=target]') |
| ready |
getElementsByClassName |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.