find ID speedtest

Benchmark created by Chris Hill on


Description

$myelem.find("#myid") vs $("#myid") speed test

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<ul>
<li id="needle"></li>
<li id="notaneedle"></li>
<li id="notaneedleeither"></li>
</ul>

Test runner

Ready to run.

Testing in
TestOps/sec
find
$("ul").find("#needle");
ready
direct
$("#needle");
ready

Revisions

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

  • Revision 1: published by Chris Hill on