Test case name | Result |
---|---|
getElementById() | |
getElementsByClassName() | |
getElementsByTagName() | |
querySelector(#id) | |
querySelector(.id) | |
querySelectorAll(tag#id) | |
querySelectorAll(.id) | |
jQuery(#id) | |
jQuery(.id) | |
jQuery(tag#id) | |
jQuery(tag.id) | |
jQuery + getElementById | |
jQuery + getElementsByClassName |
Test name | Executions per second |
---|---|
getElementById() | 1028632.0 Ops/sec |
getElementsByClassName() | 1057625.6 Ops/sec |
getElementsByTagName() | 1255337.1 Ops/sec |
querySelector(#id) | 1263273.2 Ops/sec |
querySelector(.id) | 1206710.5 Ops/sec |
querySelectorAll(tag#id) | 319226.3 Ops/sec |
querySelectorAll(.id) | 406968.1 Ops/sec |
jQuery(#id) | 1026381.4 Ops/sec |
jQuery(.id) | 240928.2 Ops/sec |
jQuery(tag#id) | 109965.4 Ops/sec |
jQuery(tag.id) | 118647.0 Ops/sec |
jQuery + getElementById | 824005.8 Ops/sec |
jQuery + getElementsByClassName | 305855.9 Ops/sec |