Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Chrome 121
Windows
Desktop
2 years ago
Benchmark.js
native - cached.
8.3M/s
native - global
4.9M/s
jQuery - find ~ cached.
692K/s
jQuery - find ~ without cache.
619K/s
jQuery - using context.
585K/s
jQuery init after using native DOM
529K/s
jQuery - using data attributes.
473K/s
View exact numbers
Test name Executions per second
native - cached. 8,337,182 Ops/sec
native - global 4,919,249 Ops/sec
jQuery - find ~ cached. 692,422 Ops/sec
jQuery - find ~ without cache. 619,436 Ops/sec
jQuery - using context. 585,353 Ops/sec
jQuery init after using native DOM 528,533 Ops/sec
jQuery - using data attributes. 473,279 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: