Data Selector Performance (v14)

Revision 14 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<ul id="test">
</ul>

Setup

var i = 500;
    var $ul = $("#test");
    $ul.html('');
    while (i > 0) {
      $ul.append('<li data-component="list-item" data-component2="list-item" class="list-item my-other-class">List Item ' + i.toString() + '</li>');
      i -= 1;
    }

Teardown


    $ul.html('');
  

Test runner

Ready to run.

Testing in
TestOps/sec
dataSelector
$ul.find('[data-component="list-item"]')
ready
classSelector
$ul.find('.list-item')
ready
two classes
$ul.find('.list-item.my-other-class')
ready
two dataSelectors
$ul.find('[data-component="list-item"][data-component2="list-item"]')
ready

Revisions

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