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
Exposes the following methods. They are all inserted into the external jQuery file.
All methods end with Until to make sure a regex passes.
Also note that I think that it somehow feels wrong to create a new jQuery instance on each iteration just to check if those nodes are the same. Any help will be appreciated here.
while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) )
<script src="https://dump.jruitenschild.nl/jquery-1.4.4-fasternextUntil-5.js"></script>
<div id="testCase">
<dl>
<dt id="term-1">term 1</dt>
<dd>definition 1-a</dd>
<dd>definition 1-b</dd>
<dd>definition 1-c</dd>
<dd>definition 1-d</dd>
<dd>definition 1-e</dd>
<dt id="term-2">term 2</dt>
<dd>definition 2-a</dd>
<dd>definition 2-b</dd>
<dd>definition 2-c</dd>
<dd>definition 2-d</dd>
<dd>definition 2-e</dd>
<dt id="term-3">term 3</dt>
<dd>definition 3-a</dd>
<dd>definition 3-b</dd>
<dd>definition 3-c</dd>
<dd>definition 3-d</dd>
<dd>definition 3-e</dd>
</dl>
</div>
<script>
main = $('#testCase');
term2 = main.find('#term-2');
term3 = main.find('#term-3');
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
standard nextUntil |
| ready |
matchesSelector instead of is() |
| ready |
Filter instead of .is() |
| ready |
Filter instead of .is() |
| ready |
Filter instead of .is() |
| ready |
DOM nodes only |
| ready |
1. DOM-node 2. Filter |
| ready |
1. DOM-node 2. Filter |
| ready |
1. DOM-node 2. Filter |
| ready |
New $.fn.is() |
| ready |
New $.fn.is() |
| ready |
New $.fn.is() |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.