Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
javiselectoptions
(version: 3)
selectoptions
Comparing performance of:
childrenfirst vs directfirst vs queryfirst vs findfirst
Created:
7 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<div> <input type="text" value=""/> <select id="sampleselect"> </select> </div> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js'></script>
Script Preparation code:
//emulate a country dropdown for(i=0; i<200; i++){ var selectElement = $('#sampleselect'), selectHtml = selectElement.html(); selectElement.html(selectHtml + "<option value='" + i + "'>" + i.toString() + "</option>"); }
Tests:
childrenfirst
$('#sampleselect').children('option').first()
directfirst
$('#sampleselect > option').first()
queryfirst
$('#sampleselect > option:first')
findfirst
$('#sampleselect').find('option').first()
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
childrenfirst
directfirst
queryfirst
findfirst
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
selectoptions
select test
jquery vs select
JQuery: find with selected selector vs filter selected selector
Comments
Confirm delete:
Do you really want to delete benchmark?