Test name | Executions per second |
---|---|
getElementById | 306914.6 Ops/sec |
querySelector("#id") | 290923.1 Ops/sec |
getElementsByClassName("class")[0] | 301745.1 Ops/sec |
querySelector(".class") | 192167.2 Ops/sec |
getElementById + getElementsByTagName | 82686.9 Ops/sec |
querySelectorAll("#id tag") | 69106.5 Ops/sec |
getElementById + getElementsByClassName[0] | 285188.7 Ops/sec |
querySelector("#id .class") | 282789.2 Ops/sec |
getElementsByClassName("class") | 83912.9 Ops/sec |
querySelectorAll(".class") | 42237.8 Ops/sec |