:first versus .first() with non-native selector (v9)

Revision 9 of this benchmark created on


Description

Using attribute selector to prevent the use of the native class selector.

Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
standard
$('.foo[x!="y"]').eq(0)
ready
:first
$('.foo[x!="y"]:eq(0)')
ready
length > 0
$('.foo[x!="y"]').length
ready

Revisions

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