jQuery .find() vs context, w/o special case (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id='myDiv'>
        <p>hello <a href="http://www.example.com/"><span id="mySpan">link</span></a></p>
        <p>world <a href="http://www.example.com/"><span id="mySpan">link</span></a></p>
</div>
<script>
  if (!window.console || !window.console.log) {
   throw 'console.log() is not supported. Please install Firebug. http://getfirebug.com'
  }
</script>

Setup

var $myDiv = $("#myDiv");

Test runner

Ready to run.

Testing in
TestOps/sec
.find()
$myDiv.find('#mySpan');
ready
context
$('#mySpan', $myDiv);
ready

Revisions

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