Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Chrome 109
Windows
Desktop
2 years ago
Benchmark.js
native - cached.
1.9M/s
native - global
1.1M/s
jQuery - find ~ cached.
110K/s
jQuery - find ~ without cache.
98K/s
jQuery - using context.
94K/s
jQuery init after using native DOM
82K/s
jQuery - using data attributes.
75K/s
View exact numbers
Test name Executions per second
native - cached. 1,862,688 Ops/sec
native - global 1,136,316 Ops/sec
jQuery - find ~ cached. 110,128 Ops/sec
jQuery - find ~ without cache. 98,312 Ops/sec
jQuery - using context. 94,459 Ops/sec
jQuery init after using native DOM 81,871 Ops/sec
jQuery - using data attributes. 75,177 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: