$('#foo') vs. $x.find('#foo')

Benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="wrap1">
<div id="wrap2">
<div id="content">
foo
</div>
</div>
</div>

Setup

$x = $('#wrap2');

Test runner

Ready to run.

Testing in
TestOps/sec
$()
var $y = $('#content');
ready
.find()
var $y = $x.find('#content');
ready

Revisions

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