Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
Chrome 73
Windows 7
Desktop
5 years ago
Test name Executions per second
querySelector (id) 423528.2 Ops/sec
querySelectorAll (id) 199227.4 Ops/sec
querySelector (class) 484108.2 Ops/sec
querySelectorAll (class) 177192.0 Ops/sec
getElementById 627490.2 Ops/sec
getElementsByClassName 726905.5 Ops/sec
jQuery (id) 371737.8 Ops/sec
jQuery (class) 92693.4 Ops/sec
Custom (id) 765958.6 Ops/sec
Custom (class) 761744.6 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)


;