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) 1791767.2 Ops/sec
querySelectorAll (id) 828632.2 Ops/sec
querySelector (class) 182803.3 Ops/sec
querySelectorAll (class) 38584.2 Ops/sec
getElementById 2135847.8 Ops/sec
getElementsByClassName 2096078.8 Ops/sec
jQuery (id) 855491.9 Ops/sec
jQuery (class) 400859.6 Ops/sec
Custom (id) 1694482.8 Ops/sec
Custom (class) 1689439.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)


;