Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Chrome 56
Mac OS X 10.10.5
Other
7 years ago
Test name Executions per second
querySelector (id) 1806678.1 Ops/sec
querySelectorAll (id) 878484.6 Ops/sec
querySelector (class) 182220.8 Ops/sec
querySelectorAll (class) 41683.1 Ops/sec
getElementById 2054818.0 Ops/sec
getElementsByClassName 2077307.9 Ops/sec
jQuery (id) 851111.4 Ops/sec
jQuery (class) 400849.5 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • querySelector (id)

  • querySelectorAll (id)

  • querySelector (class)

  • querySelectorAll (class)

  • getElementById

  • getElementsByClassName

  • jQuery (id)

  • jQuery (class)

  • Custom (id)

  • Custom (class)


;