$('#id') vs $(document.getElementById(id)) (v5)

Revision 5 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="qwe"></div>

Setup

var id, tag, temp;

Test runner

Ready to run.

Testing in
TestOps/sec
$ + sizzle
id  = $('#qwe');
ready
asdad
temp = qwe;
id = ( typeof temp === "undefined" ? undefined : temp );
ready
native
id  = document.getElementById('qwe');
id = id == null ? undefined : id
ready

Revisions

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