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 the performance between jquery.html("") and jquery.children().remove()
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<style>#t1 div, #t2 div{width:0px; height:0px; overflow:hidden}</style>
<div id="t1"></div>
<div id="t2"></div>
var $t1 = $("#t1");
for(var x = 0; x < 300; x++){
var a = $("<div></div>");
a.append("<div><h1>hello</h1></div>");
a.append("<div><h1>world<h1></div>");
a.append("<div><h1>!<h1></div>");
$t1.append(a);
}
var $t2 = $("#t2");
for(var x = 0; x < 300; x++){
var a = $("<div></div>");
a.append("<div><h1>hello</h1></div>");
a.append("<div><h1>world<h1></div>");
a.append("<div><h1>!<h1></div>");
$t2.append(a);
}
Ready to run.
Test | Ops/sec | |
---|---|---|
html("") |
| ready |
children().remove() |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.