Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36 Edg/97.0.1072.55
Chrome 97
Windows
Desktop
2 years ago
Test name Executions per second
jQuery - find ~ cached. 475163.0 Ops/sec
jQuery - find ~ without cache. 421087.6 Ops/sec
native - global 3844938.8 Ops/sec
native - cached. 6225633.5 Ops/sec
jQuery - using context. 398155.3 Ops/sec
jQuery - using data attributes. 315974.3 Ops/sec
jQuery init after using native DOM 343871.9 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • jQuery - find ~ cached.

  • jQuery - find ~ without cache.

  • native - global

  • native - cached.

  • jQuery - using context.

  • jQuery - using data attributes.

  • jQuery init after using native DOM


;