Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36 Edg/93.0.961.52
Chrome 93
Windows
Desktop
3 years ago
Test name Executions per second
Select Element by ID - Javascript 3717111.8 Ops/sec
Change CSS - jQuery 283155.8 Ops/sec
Change CSS - Javascript 604164.3 Ops/sec
Select Element by ID - jQuery 1554296.0 Ops/sec
Change inner text - Javascript 5675591.5 Ops/sec
Change inner text - jQuery 712578.0 Ops/sec
Get element by tag name - Javascript 3360387.2 Ops/sec
Get element by tag name - jQuery 709619.7 Ops/sec
Get element by name - Javascript 51597.7 Ops/sec
Get element by name - jQuery 38527.1 Ops/sec
Get element by existing attribute - Javascript 52472.7 Ops/sec
Get element by existing attribute - jQuery 43385.2 Ops/sec
Get element by class name - Javascript 4567367.0 Ops/sec
Get element by class name - jQuery 730302.3 Ops/sec
Select sub-element - Javascript 3452059.5 Ops/sec
Select sub-element - jQuery 1116049.8 Ops/sec
Loop through elements - Javascript 303341.1 Ops/sec
Loop through elements - jQuery 58869.7 Ops/sec
Add and remove Element - Javascript 584756.2 Ops/sec
Add and remove Element - jQuery 102369.0 Ops/sec
Add and Remove Class - Javascript 618682.2 Ops/sec
Add and Remove Class - jQuery 201746.5 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • Select Element by ID - Javascript

  • Add and remove Element - jQuery

  • Add and remove Element - Javascript

  • Loop through elements - jQuery

  • Loop through elements - Javascript

  • Select sub-element - jQuery

  • Select sub-element - Javascript

  • Get element by class name - jQuery

  • Get element by class name - Javascript

  • Get element by existing attribute - jQuery

  • Get element by existing attribute - Javascript

  • Get element by name - jQuery

  • Get element by name - Javascript

  • Get element by tag name - jQuery

  • Get element by tag name - Javascript

  • Change inner text - jQuery

  • Change inner text - Javascript

  • Select Element by ID - jQuery

  • Change CSS - Javascript

  • Change CSS - jQuery

  • Add and Remove Class - Javascript

  • Add and Remove Class - jQuery


;