Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0
Firefox 66
Windows 7
Desktop
5 years ago
Test name Executions per second
querySelector (id) 795417.8 Ops/sec
querySelectorAll (id) 323647.3 Ops/sec
querySelector (class) 813353.6 Ops/sec
querySelectorAll (class) 277111.2 Ops/sec
getElementById 1090017.2 Ops/sec
getElementsByClassName 1613845.5 Ops/sec
jQuery (id) 669378.8 Ops/sec
jQuery (class) 128294.7 Ops/sec
Custom (id) 946921.4 Ops/sec
Custom (class) 1107357.8 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)


;