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
.firstChild is always faster than .lastChild
<script src="//code.jquery.com/jquery-git2.min.js"></script>
<ul id="my_list"></ul>
<script>
$(function() {
var i = 0, len = 20;
while (i++ < len) {
$('#my_list').append( $('<li>').html('list item ' + i) );
}
});
</script>
var $ul = $('#my_list'),
el = document.getElementById('my_list'),
$clone = $ul.children().clone(),
child;
$ul.html($clone);
Ready to run.
Test | Ops/sec | |
---|---|---|
innerHTML 1 |
| ready |
innerHTML 2 |
| ready |
jquery html |
| ready |
jquery empty |
| ready |
jquery remove 1 |
| ready |
jquery remove 2 |
| ready |
custom 1 |
| ready |
custom 2 |
| ready |
custom 3 |
| ready |
custom 4 |
| ready |
custom 5 |
| ready |
custom 6 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.