Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0
Chrome 119
Windows
Desktop
2 years ago
Benchmark.js
native - cached.
4.8M/s
native - global
3.3M/s
jQuery - find ~ cached.
331K/s
jQuery - find ~ without cache.
288K/s
jQuery - using context.
288K/s
jQuery init after using native DOM
286K/s
jQuery - using data attributes.
227K/s
View exact numbers
Test name Executions per second
native - cached. 4,786,976 Ops/sec
native - global 3,290,320 Ops/sec
jQuery - find ~ cached. 330,907 Ops/sec
jQuery - find ~ without cache. 288,296 Ops/sec
jQuery - using context. 288,083 Ops/sec
jQuery init after using native DOM 285,626 Ops/sec
jQuery - using data attributes. 226,797 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: