jQuery - find ~ cached. vs jQuery - find ~ without cache. vs native - global vs native - cached. vs jQuery - using context. vs jQuery - using data attributes. vs jQuery init after using native DOMFastest: native - cached. (17.6x faster)
8,337,182 ops/sec
5,312,168 ops/sec
717,598 ops/sec
645,862 ops/sec
625,983 ops/sec
528,533 ops/sec
473,279 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| jQuery - find ~ cached. | |
| jQuery - find ~ without cache. | |
| native - global | |
| native - cached. | |
| jQuery - using context. | |
| jQuery - using data attributes. | |
| jQuery init after using native DOM |
| Test name | Executions per second |
|---|---|
| ✓ native - global | 25,943,236 Ops/sec |
| native - cached. | 25,822,830 Ops/sec |
| jQuery - find ~ cached. | 1,564,850 Ops/sec |
| jQuery - find ~ without cache. | 1,434,935 Ops/sec |
| jQuery init after using native DOM | 1,348,433 Ops/sec |
| jQuery - using context. | 1,126,284 Ops/sec |
| jQuery - using data attributes. | 688,067 Ops/sec |