Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Chrome 120
Windows
Desktop
2 years ago
Benchmark.js
native - cached.
15.0M/s
native - global
9.3M/s
jQuery - find ~ cached.
1.2M/s
jQuery - find ~ without cache.
1.0M/s
jQuery - using context.
987K/s
jQuery init after using native DOM
845K/s
jQuery - using data attributes.
785K/s
View exact numbers
Test name Executions per second
native - cached. 14,966,433 Ops/sec
native - global 9,331,355 Ops/sec
jQuery - find ~ cached. 1,186,012 Ops/sec
jQuery - find ~ without cache. 1,034,944 Ops/sec
jQuery - using context. 987,281 Ops/sec
jQuery init after using native DOM 844,722 Ops/sec
jQuery - using data attributes. 785,024 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: