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
innerHTML vs different versions of jQuery.html()
<div id="test" style="height:100px; overflow:scroll"></div>
<script src="//code.jquery.com/jquery-1.9.0.min.js"></script>
<script type="text/javascript">
var $190 = jQuery.noConflict();
</script>
<script src="//code.jquery.com/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
var $182 = jQuery.noConflict();
</script>
<script src="//code.jquery.com/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
var $171 = jQuery.noConflict();
</script>
<script src="//code.jquery.com/jquery-1.6.1.min.js"></script>
<script type="text/javascript">
var $161 = jQuery.noConflict();
</script>
<script src="//code.jquery.com/jquery-1.2.6.min.js"></script>
<script type="text/javascript">
var $126 = jQuery.noConflict();
</script>
<script type="text/javascript">
var testEl = document.getElementById('test');
var $190test = $190('#test');
var $182test = $182('#test');
var $171test = $171('#test');
var $161test = $161('#test');
var $126test = $126('#test');
</script>
var html = [];
for(var i = 0; i < 250; i++) {
html.push('<div class="test">Test</div>');
}
html_string = html.join('');
testEl.innerHTML = '';
Ready to run.
Test | Ops/sec | |
---|---|---|
innerHTML |
| ready |
jQuery.html() - v1.9.0 |
| ready |
jQuery.html() - v1.8.2 |
| ready |
jQuery.html() - v1.7.1 |
| ready |
jQuery.html() - v1.6.1 |
| ready |
jQuery.html() - v1.2.6 |
| ready |
innerHtml 2 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.