parentNode vs jQuery parent (v5)

Revision 5 of this benchmark created on


Description

Speed difference between jQuery helper method and raw JS

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
var parent;
var child;
</script>

<div id="parent">
  <div id="child"></div>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
Native parentNode
var child = document.getElementById('child'), parent = $(child.parentNode);
 
ready
jQuery Parent
var child = document.getElementById('child'), parent = $(child).parent();
 
ready

Revisions

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