Sizzle's selectors with redundant qualifiers (v4)

Revision 4 of this benchmark created by sanbor on


Description

According to https://developers.google.com/speed/docs/best-practices/rendering?hl=es-419 is more performant to do .foo than p.foo.

Let's check if this is true for jQuery's Sizzle.

Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
.class
$('.foo');
ready
tag.class
$('p.foo');
ready

Revisions

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