which is faster children() or find()

Benchmark created by Maurizio on


Description

Testing which method is faster children() or find() on given DOM structure

Preparation HTML

<div class="row">
  <label class="required" for="Company_ac1">
    Assigned categories 1
    <span class="required">
      *
    </span>
  </label>
  <input type="hidden" name="Company[ac1]" value="" id="ytCompany_ac1">
  <span id="Company_ac1">
    <input type="checkbox" name="Company[ac1][]" value="0" id="Company_ac1_0">
    <label for="Company_ac1_0">
      Prva kategorija X
    </label>
    <br>
    <input type="checkbox" name="Company[ac1][]" value="2" id="Company_ac1_1">
    <label for="Company_ac1_1">
      Druga kategorija
    </label>
    <br>
    <input type="checkbox" name="Company[ac1][]" value="3" id="Company_ac1_2">
    <label for="Company_ac1_2">
      Treca kategorija
    </label>
    <br>
    <input type="checkbox" name="Company[ac1][]" value="4" id="Company_ac1_3">
    <label for="Company_ac1_3">
      Cetvrta kategorija
    </label>
  </span>
  <div style="display:none" id="Company_ac1_em_" class="errorMessage">
  </div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
children()
$('#Company_ac1').children(':checked');
ready
find()
$('#Company_ac1').find(':checked');
ready

Revisions

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