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) 1866402.5 Ops/sec
querySelectorAll (id) 855731.0 Ops/sec
querySelector (class) 188327.2 Ops/sec
querySelectorAll (class) 42616.8 Ops/sec
getElementById 2077393.9 Ops/sec
getElementsByClassName 1974747.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)


;