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 | |
querySelectorAll in function |
Test name | Executions per second |
---|---|
getElementById() | 12466793.0 Ops/sec |
getElementsByClassName() | 10529344.0 Ops/sec |
getElementsByTagName() | 10486617.0 Ops/sec |
querySelector(#id) | 5575179.5 Ops/sec |
querySelector(.id) | 5782625.5 Ops/sec |
querySelectorAll(#id) | 3628498.2 Ops/sec |
querySelectorAll(.id) | 7159833.5 Ops/sec |
jQuery(#id) | 6717068.0 Ops/sec |
jQuery(.id) | 4713057.5 Ops/sec |
jQuery(tag#id) | 2842685.0 Ops/sec |
jQuery(tag.id) | 2855967.2 Ops/sec |
jQuery + getElementById | 5638867.5 Ops/sec |
jQuery + getElementsByClassName | 4731742.0 Ops/sec |
jQuery + querySelectorAll | 3974278.2 Ops/sec |
querySelectorAll in function | 7030800.0 Ops/sec |