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

Revision 7 of this benchmark created on


Preparation HTML

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

Setup

var id, tag;

Test runner

Ready to run.

Testing in
TestOps/sec
$ + sizzle
id = $('#id');
tag = $('div');
ready
$ + native
id = $(document.getElementById('id'));
tag = $(document.getElementsByTagName('div'));
ready

Revisions

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