Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
Chrome 76
Mac OS X 10.14.5
Desktop
5 years ago
Test name Executions per second
Select Element by ID - Javascript 4362286.0 Ops/sec
Change CSS - jQuery 257685.4 Ops/sec
Change CSS - Javascript 585529.6 Ops/sec
Select Element by ID - jQuery 1546059.6 Ops/sec
Change inner text - Javascript 6782990.5 Ops/sec
Change inner text - jQuery 148668.0 Ops/sec
Get element by tag name - Javascript 3500835.8 Ops/sec
Get element by tag name - jQuery 604067.3 Ops/sec
Get element by name - Javascript 1908977.0 Ops/sec
Get element by name - jQuery 295391.8 Ops/sec
Get element by existing attribute - Javascript 1872433.8 Ops/sec
Get element by existing attribute - jQuery 327425.0 Ops/sec
Get element by class name - Javascript 3898827.2 Ops/sec
Get element by class name - jQuery 693439.8 Ops/sec
Select sub-element - Javascript 2963450.5 Ops/sec
Select sub-element - jQuery 1000426.1 Ops/sec
Loop through elements - Javascript 327514.4 Ops/sec
Loop through elements - jQuery 10871.8 Ops/sec
Add and remove Element - Javascript 147061.6 Ops/sec
Add and remove Element - jQuery 40815.6 Ops/sec
Add and Remove Class - Javascript 492939.9 Ops/sec
Add and Remove Class - jQuery 177822.0 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


;