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.
8.3M/s
native - global
5.3M/s
jQuery - find ~ cached.
718K/s
jQuery - find ~ without cache.
646K/s
jQuery - using context.
626K/s
jQuery init after using native DOM
507K/s
jQuery - using data attributes.
449K/s
View exact numbers
Test name Executions per second
native - cached. 8,337,274 Ops/sec
native - global 5,312,168 Ops/sec
jQuery - find ~ cached. 717,598 Ops/sec
jQuery - find ~ without cache. 645,862 Ops/sec
jQuery - using context. 625,983 Ops/sec
jQuery init after using native DOM 507,087 Ops/sec
jQuery - using data attributes. 449,220 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: