native-id-selection-vs-jquery-id-selector (v2)

Revision 2 of this benchmark created on


Description

How much faster is getElementById vs jQuery ID selector

Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
Native
var foo = document.getElementById('foo');
ready
jQuery
var foo = $('#foo');
ready
jQuery object
var foo = $(document.getElementById('foo'));
ready

Revisions

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