jQuery children vs find

JavaScript performance comparison

Revision 75 of this test case created by traBolic

Info

This testcase compares the performance of .children() and .find()

Preparation code

<div class="Users">
   <fieldset>
    <input type="hidden" class="toggle" id="a"><h1><legend><label for="a">Adminler</label></legend></h1>
    <div class="KisiListe">asd</div>
   </fieldset>
   <fieldset>
    <input type="hidden" class="toggle" id="m"><h1><legend><label for="m">Müdürler</label></legend></h1>
    <div class="KisiListe">asd</div>
   </fieldset>
   <fieldset>
    <input type="hidden" class="toggle" id="s"><h1><legend><label for="s">Supervisorlar</label></legend></h1>
    <div class="KisiListe">asd</div>
   </fieldset>
   <fieldset>
    <input type="hidden" class="toggle" id="c"><h1><legend><label for="c">Coachlar</label></legend></h1>
    <div class="KisiListe">asd</div>
   </fieldset>
   <fieldset>
    <input type="hidden" class="toggle" id="tl"><h1><legend><label for="tl">Takım Liderleri</label></legend></h1>
    <div class="KisiListe">asd</div>
   </fieldset>
   <fieldset>
    <input type="hidden" class="toggle" id="mt"><h1><legend><label for="mt">Müşteri Temsilcileri</label></legend></h1>
    <div class="KisiListe">asd</div>
   </fieldset>
  </div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Preparation code output

asd

asd

asd

asd

asd

asd

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
children
$('.Users fieldset h1 legend').children("label");
pending…
find
$('.Users fieldset h1 legend').find('label');
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment