HTML Preparation code:
x
 
1
<ul>
2
    <li class="current">1</li>
3
    <li>2</li>
4
    <li>3</li>     
5
</ul>
6
7
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
Script Preparation code:
 
item = $('.current');
Tests:
  • Parent

     
    console.log(item.parent());
  • Closest

     
    console.log(item.closest('ul'));
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Parent
    Closest

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0
Firefox 110 on Windows
View result in a separate tab
Test name Executions per second
Parent 165070.6 Ops/sec
Closest 157697.2 Ops/sec