$(this).find(selector) vs $(selector, this)

Benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="container">
  <div>
    <div id="content"></div>
  </div>
</div>

Setup

window.container = document.getElementById("container");

Teardown


    delete window.container;
  

Test runner

Ready to run.

Testing in
TestOps/sec
$(this).find(selector)
$(container).find(".target").html("My HTML");
ready
$(selector, this)
$(".target", container).html("My HTML");
ready

Revisions

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