Test case name | Result |
---|---|
getElementById() | |
getElementsByClassName() | |
getElementsByTagName() | |
querySelector(#id) | |
querySelector(.id) | |
querySelectorAll(#id) | |
querySelectorAll(.id) | |
jQuery(#id) | |
jQuery(.id) | |
jQuery(tag#id) | |
jQuery(tag.id) | |
jQuery + getElementById | |
jQuery + getElementsByClassName | |
jQuery + querySelectorAll |
Test name | Executions per second |
---|---|
getElementById() | 3965512.8 Ops/sec |
getElementsByClassName() | 3015661.0 Ops/sec |
getElementsByTagName() | 2963055.2 Ops/sec |
querySelector(#id) | 2185863.8 Ops/sec |
querySelector(.id) | 2918715.0 Ops/sec |
querySelectorAll(#id) | 955129.3 Ops/sec |
querySelectorAll(.id) | 1228195.6 Ops/sec |
jQuery(#id) | 992373.8 Ops/sec |
jQuery(.id) | 597203.2 Ops/sec |
jQuery(tag#id) | 432423.0 Ops/sec |
jQuery(tag.id) | 477408.8 Ops/sec |
jQuery + getElementById | 1412367.9 Ops/sec |
jQuery + getElementsByClassName | 389599.6 Ops/sec |
jQuery + querySelectorAll | 382290.7 Ops/sec |