$("#id") vs $(document.getElementById) (v17)

Revision 17 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/mootools/1.3/mootools-yui-compressed.js"></script>


<div id="LOL"></div>

Test runner

Ready to run.

Testing in
TestOps/sec
#id
$("LOL");
ready
native
document.getElementById("LOL");
ready
Slick
Slick.find(document, "[id=LOL]");
ready
Slick implicit
Slick.find(document, "div#LOL");
ready
native queryselectorall
document.querySelectorAll('#LOL');
ready
native queryselector
document.querySelector('#LOL');
ready
document.getElement
document.getElement("div#LOL");
ready
getElementById extend
$(document.getElementById("LOL"));
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.