jQuery children vs find

JavaScript performance comparison

Revision 61 of this test case created by

Preparation code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id='goals'>
		<div id='goals_image' class='image_holder'><img src='images/goals.png'><img class='blue_image' src='images/goals_blue.png'></div>
		<div id='goals_text'>
			<span class='header'>Our goals</span><br/>
			When it comes to treading lighter on the earth, we always want to be better tomorrow than we are today. That's why we have measurable targets for people and nature.
		</div>
		<div class='more'>Learn more</div>
	</div>
    

Preparation code output

<div id='goals'> <div id='goals_image' class='image_holder'><img src='images/goals.png'><img class='blue_image' src='images/goals_blue.png'></div> <div id='goals_text'> <span class='header'>Our goals</span><br/> When it comes to treading lighter on the earth, we always want to be better tomorrow than we are today. That's why we have measurable targets for people and nature. </div> <div class='more'>Learn more</div> </div>

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
children()
var $this = $('#goals')

$this.find('> *');
pending…
find()
var $this = $('#goals')

$this.find('> *')
pending…
children() no variable
$('#goals').children('> *')
pending…
find() no variable
$('#goals').find('> *')
$('#goals').find('> *')
$('#goals')
pending…
children() 1 sub
var $this = $('#goals')

$this.children('> *')
pending…
find() 1 sub
var $this = $('#goals')

$this.find('> *')
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.

0 Comments

Our goals
When it comes to treading lighter on the earth, we always want to be better tomorrow than we are today. That's why we have measurable targets for people and nature.
Learn more