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
Tests against - .children().remove() - .empty() - .html('')
When replacing the contents of an element
<select class="options">
<option value="0">Select Old</option>
<option value="1">First Old</option>
<option value="2">Second Old</option>
<option value="3">Third Old</option>
<option value="4">Fourth Old</option>
<option value="5">Fifth Old</option>
</select>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
var $options = jQuery('select.options');
var optionHTML = '<option value="0">Select New</option><option value="1">First New</option><option value="2">Second New</option><option value="3">Third New</option><option value="4">Fourth New</option><option value="5">Fifth New</option>';
Ready to run.
Test | Ops/sec | |
---|---|---|
.children().remove() |
| ready |
.empty() |
| ready |
.html() |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.