Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Chrome 124
Windows
Desktop
2 years ago
Benchmark.js
native - cached.
9.6M/s
native - global
5.6M/s
jQuery - find ~ cached.
846K/s
jQuery - find ~ without cache.
748K/s
jQuery - using context.
710K/s
jQuery init after using native DOM
615K/s
jQuery - using data attributes.
570K/s
View exact numbers
Test name Executions per second
native - cached. 9,572,031 Ops/sec
native - global 5,567,694 Ops/sec
jQuery - find ~ cached. 845,522 Ops/sec
jQuery - find ~ without cache. 747,719 Ops/sec
jQuery - using context. 710,134 Ops/sec
jQuery init after using native DOM 615,050 Ops/sec
jQuery - using data attributes. 569,534 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: