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
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div id="list" style="display:none">
</div>
var html = '';
for (var i = 0; i < 20; i++) {
html += '<div>Test ' + i + '</div>';
}
var htmlArray = [];
for (var i = 0; i < 20; i++) {
htmlArray[i] = '<div>Test ' + i + '</div>';
}
Ready to run.
Test | Ops/sec | |
---|---|---|
jQuery .append() at end |
| ready |
jQuery .html() at end |
| ready |
javascript innerHTML at end |
| ready |
javascript innerHTML at end (including string concat time) |
| ready |
jQuery .append() in loop |
| ready |
jQuery .html() in loop |
| ready |
javascript innerHTML in loop |
| ready |
jQuery append($) at end |
| ready |
jQuery append(array) at end |
| ready |
jQuery append(array) at end, showing array build time |
| ready |
javascript innerHTML at end (including array push time) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.