jquery选择器性能测试

JavaScript performance comparison

Revision 3 of this test case created

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div id="text">
  <p>
     <input type="text" />
  </p>
  <div class="aaron">
     <input id='aaron' type="checkbox" name="readme" value="Submit" />
     <p>Sizzle</p>
  </div>
</div>

Preparation code output

Sizzle

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
id
$('#aaron')
pending…
div > p + div.aaron input[type="checkbox"]
pending…
在元素集合中查找
$('input ')
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. Here’s a list of current revisions for this page:

0 comments

Add a comment