parentNode vs jQuery parent (v2)

Revision 2 of this benchmark created on


Description

Speed difference between jQuery helper method and raw JS

Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

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

Test runner

Ready to run.

Testing in
TestOps/sec
parentNode
var child = document.getElementById('child'),
    parent = $(child)[0].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.