text node vs innerhtml in jquery (v6)

Revision 6 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id='test'>some text</div>

Test runner

Ready to run.

Testing in
TestOps/sec
text
$('#test').text('This node is awesome!!!');
ready
html
$('#test').html('This node is awesome!!!');
ready
textNode nodeValue (requires exactly one existing child text node)
$('#test').get()[0].childNodes[0].nodeValue = 'This node is awesome!!!';
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.