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

Revision 4 of this benchmark created by Ates Goral 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

Revisions

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