Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15
Safari 14
Mac OS X 10.15.7
Desktop
3 years ago
Test name Executions per second
jQuery - find ~ cached. 2270908.8 Ops/sec
jQuery - find ~ without cache. 1966094.0 Ops/sec
native - global 11403860.0 Ops/sec
native - cached. 18367152.0 Ops/sec
jQuery - using context. 1818758.2 Ops/sec
jQuery - using data attributes. 1602925.2 Ops/sec
jQuery init after using native DOM 2252007.5 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


;