Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
Chrome 76
Mac OS X 10.15.0
Desktop
5 years ago
Test name Executions per second
Select Element by ID - Javascript 5225822.0 Ops/sec
Change CSS - jQuery 307699.7 Ops/sec
Change CSS - Javascript 758690.9 Ops/sec
Select Element by ID - jQuery 1982410.4 Ops/sec
Change inner text - Javascript 8799676.0 Ops/sec
Change inner text - jQuery 209851.3 Ops/sec
Get element by tag name - Javascript 4575713.0 Ops/sec
Get element by tag name - jQuery 785413.8 Ops/sec
Get element by name - Javascript 51867.7 Ops/sec
Get element by name - jQuery 41535.9 Ops/sec
Get element by existing attribute - Javascript 49129.3 Ops/sec
Get element by existing attribute - jQuery 46260.2 Ops/sec
Get element by class name - Javascript 5272883.0 Ops/sec
Get element by class name - jQuery 880015.8 Ops/sec
Select sub-element - Javascript 3727987.2 Ops/sec
Select sub-element - jQuery 1222835.6 Ops/sec
Loop through elements - Javascript 386892.2 Ops/sec
Loop through elements - jQuery 16417.3 Ops/sec
Add and remove Element - Javascript 184219.8 Ops/sec
Add and remove Element - jQuery 49014.7 Ops/sec
Add and Remove Class - Javascript 537231.3 Ops/sec
Add and Remove Class - jQuery 182689.2 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


;