Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
Chrome 76
Mac OS X 10.14.1
Desktop
5 years ago
Test name Executions per second
Select Element by ID - Javascript 3508309.0 Ops/sec
Change CSS - jQuery 219603.7 Ops/sec
Change CSS - Javascript 520613.2 Ops/sec
Select Element by ID - jQuery 1214420.4 Ops/sec
Change inner text - Javascript 5358555.0 Ops/sec
Change inner text - jQuery 491382.9 Ops/sec
Get element by tag name - Javascript 3474987.0 Ops/sec
Get element by tag name - jQuery 573145.5 Ops/sec
Get element by name - Javascript 37345.0 Ops/sec
Get element by name - jQuery 30251.1 Ops/sec
Get element by existing attribute - Javascript 35629.0 Ops/sec
Get element by existing attribute - jQuery 31556.9 Ops/sec
Get element by class name - Javascript 3593028.8 Ops/sec
Get element by class name - jQuery 663907.6 Ops/sec
Select sub-element - Javascript 2619734.8 Ops/sec
Select sub-element - jQuery 848359.2 Ops/sec
Loop through elements - Javascript 255742.8 Ops/sec
Loop through elements - jQuery 42299.4 Ops/sec
Add and remove Element - Javascript 412895.5 Ops/sec
Add and remove Element - jQuery 49757.2 Ops/sec
Add and Remove Class - Javascript 424278.5 Ops/sec
Add and Remove Class - jQuery 122094.1 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


;