Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36
Chrome 99
Windows
Desktop
2 years ago
Test name Executions per second
Context Selector 1162445.9 Ops/sec
Find 1367354.6 Ops/sec
Name Selector 75255.7 Ops/sec
HTML Preparation code:
AخA
 
1
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
2
<div id="#test-root"><div name="test-child"></div></div>    
Tests:
  • Context Selector

     
    jQuery('[name=test-child]', '#test-root').css('border', '1px solid red');
  • Find

     
    jQuery('#test-root').find('[name=test-child]').css('border', '1px solid red');
  • Name Selector

     
    jQuery('[name=test-child]').css('border', '1px solid red');
  • Context Object Selector

     
    jQuery('[name=test-child]', jQuery('#test-root')).css('border', '1px solid red');