Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Vanilla JS VS JQuery DOM perfomance + getbyid(elId)
Vanilla JS VS JQuery DOM perfomance
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0
Browser:
Chrome 132
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
getbyid
1.3M/s
Vanilla JS
1.1M/s
Jquery
224K/s
View exact numbers
Test name
Executions per second
✓
getbyid
1,253,308 Ops/sec
Vanilla JS
1,102,080 Ops/sec
Jquery
224,087 Ops/sec
HTML Preparation code:
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <div id="nhngodo">Hi! NHNgodo!</div> <script> window._getbyid = {}; function getbyid(elId){ if(!window._getbyid[elId]){ window._getbyid[elId] = document.getElementById(elId); } return window._getbyid[elId]; } </script>
Tests:
Vanilla JS
var el = document.getElementById("nhngodo"); el.innerText = "Hi! NHNgodo!";
Jquery
$("#nhngodo").text("Hi! NHNgodo!");
getbyid
getbyid("nhngodo").innerText = "Hi! NHNgodo!";