Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Test de By Id
(version: 0)
test
Comparing performance of:
Vanilla JS vs Jquery
Created:
5 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.1.0.min.js"></script> <div id="testElement"></div>
Script Preparation code:
var el; var map = new Map(); //a cache :P function id(theId){ if(!map[theId]){ el = document.getElementById(theId); map[theId] = el; } else { el = map[theId]; } return el; }
Tests:
Vanilla JS
var el = id("testElement"); var className = el.className;
Jquery
var el = $("#testElement")[0]; var className = el.className;
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Vanilla JS
Jquery
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
jQuery by id vs Document.getElementById
Fastest Way to Get Element By ID
jQuery by id vs Document.getElementById1
jQuery by id vs Document.getElementById no classname
jQuery by id vs Document.getElementById2
Comments
Confirm delete:
Do you really want to delete benchmark?