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
Compare performance of jQuery .text() and .html() methods when setting values. These values include not only plain text, but HTML to be rendered with using .html()
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<p id="text">Test text</p>
<script>
var $text = $("#text");
</script>
$("#text").html('Initialized State, differs from the text/html being applied to this container.');
Ready to run.
Test | Ops/sec | |
---|---|---|
text() with plain text |
| ready |
html() with plain text |
| ready |
html() with HTML |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.