Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36 Edg/91.0.864.41
Chrome 91
Mac OS X 10.15.7
Desktop
3 years ago
Test name Executions per second
jQuery 3.3.1 addClass/removeClass 269006.7 Ops/sec
jQuery 2.1.4 addClass/removeClass 366018.6 Ops/sec
Vanilla JS classList add/remove 624777.6 Ops/sec
HTML Preparation code:
Tests:
  • jQuery 3.3.1 addClass/removeClass

  • jQuery 2.1.4 addClass/removeClass

  • Vanilla JS classList add/remove


;