jQuery Attribute selector performance (v10)

Revision 10 of this benchmark created by jiang on


Description

Test to see if jQuery filters by selector before doing attribute matching.

Preparation HTML

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

<b class="t" name="test0" id="id_test0"></b>
<b class="t" name="test0" id="id_test1"></b>
<b class="t" name="test0" id="id_test2"></b>
<b class="t" name="test1" id="id_test3"></b>
<b class="t" name="test1" id="id_test4"></b>
<b class="t" name="test1" id="id_test5"></b>

Test runner

Ready to run.

Testing in
TestOps/sec
tag+attr id
$('b[id="id_test3"]');
ready
byid
$("#id_test3");
ready
name
$('b[name="test3"]');
ready

Revisions

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