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.8M/s
native - global
1.1M/s
jQuery - find ~ cached.
115K/s
jQuery - find ~ without cache.
94K/s
jQuery - using context.
90K/s
jQuery init after using native DOM
79K/s
jQuery - using data attributes.
72K/s
View exact numbers
Test name Executions per second
native - cached. 1,784,914 Ops/sec
native - global 1,072,143 Ops/sec
jQuery - find ~ cached. 115,376 Ops/sec
jQuery - find ~ without cache. 94,037 Ops/sec
jQuery - using context. 89,803 Ops/sec
jQuery init after using native DOM 78,785 Ops/sec
jQuery - using data attributes. 71,658 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: