jQuery by id vs Document.getElementById

Comparing speed of getting element by id with jQuery vs Vanilla JS
3 years ago
User agent: Mozilla/5.0 (Linux; Android 4.4.2; LG-D325 Build/KOT49I.A1415155364) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36
Test name Executions per second
jQuery 55620.4 Ops/sec
Vanilla JS 212696.8 Ops/sec
HTML Preparation code:
Tests:
  • jQuery

  • Vanilla JS

Open this result on MeasureThat.net