getting the html tag with querySelector vs getting the html tag with closestFastest: getting the html tag with querySelector (2.3x faster)
11,706,380 ops/sec
5,173,710 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| getting the html tag with querySelector | |
| getting the html tag with closest |
| Test name | Executions per second |
|---|---|
| ✓ getting the html tag with closest | 6,915,708 Ops/sec |
| getting the html tag with querySelector | 4,564,749 Ops/sec |