jQuery vs vanilla JavaScript (v8)

Revision 8 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<p>
  Some text in the first paragraph.
</p>
<p>
  Some more text, but in a different paragraph.
</p>

Test runner

Ready to run.

Testing in
TestOps/sec
plain JavaScript
document.getElementsByTagName('p')[0].innerHTML = 'Hello!!';
ready
jQuery .text()
$('p').eq(0).text('Hello!!');
ready
jQuery .html()
$('p').eq(0).html('Hello!!');
ready

Revisions

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