getElementById vs querySelector(ID) vs querySelectorAll(ID) vs exposed global object vs exposed under the window object| Test case name | Result |
|---|---|
| getElementById | |
| querySelector(ID) | |
| querySelectorAll(ID) | |
| exposed global object | |
| exposed under the window object |
| Test name | Executions per second |
|---|---|
| ✓ getElementById | 5,675,634 Ops/sec |
| querySelector(ID) | 4,146,978 Ops/sec |
| exposed under the window object | 2,249,640 Ops/sec |
| exposed global object | 1,824,971 Ops/sec |
| querySelectorAll(ID) | 1,771,240 Ops/sec |