jQuery by id vs Document.getElementById

Comparing speed of getting element by id with jQuery vs Vanilla JS
6 years ago
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36
Test name Executions per second
jQuery 1220053.0 Ops/sec
Vanilla JS 2511432.0 Ops/sec
HTML Preparation code:
Tests:
  • jQuery

  • Vanilla JS

Open this result on MeasureThat.net