Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
jQuery parents() vs closest() speed performance comparison
Comparing performance of: Parent vs Closest
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0
Browser:
Chrome 143
Operating system:
Windows
Device Platform:
Desktop
Date tested:
8 months ago
Benchmark engine:
Benchmark.js
Closest
137K/s
Parents
122K/s
View exact numbers
Test name
Executions per second
✓
Closest
136,636 Ops/sec
Parents
122,360 Ops/sec
HTML Preparation code:
<ul> <li class="current">1</li> <li>2</li> <li>3</li> </ul> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
Script Preparation code:
item = $('.current');
Tests:
Parents
console.log(item.parents('ul'));
Closest
console.log(item.closest('ul'));