Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/74.0.3729.121 Mobile/15E148 Safari/605.1
Chrome Mobile iOS 74
iOS 12.2
Mobile
5 years ago
Test name Executions per second
Vanilla getElementById(id) 1367216.8 Ops/sec
Vanilla querySelector(#id) 937103.7 Ops/sec
Vanilla querySelectorAll(#id) 708162.9 Ops/sec
jQuery(#id) 665615.8 Ops/sec
HTML Preparation code:
Tests:
  • Vanilla getElementById(id)

  • Vanilla querySelector(#id)

  • Vanilla querySelectorAll(#id)

  • jQuery(#id)