HTML Preparation code:
AخA
 
1
<div id='testId'></div>
2
<div class='testClass'></div>
3
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js'></script>
Tests:
  • Get by id

     
    $('#testId').css("background-color", "#cccccc")
  • Get by class

     
    $('.testClass').css("background-color", "#cccccc")
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Get by id
    Get by class

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36
Chrome 80 on Windows
View result in a separate tab
Test name Executions per second
Get by id 282836.5 Ops/sec
Get by class 209526.2 Ops/sec