getElementById VS jQuery('#id') (v181)

Revision 181 of this benchmark created on


Description

With latest jQuery 2.

Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<p id="foo">
  Test
</p>
<p id="bar">
  bars</p>

Test runner

Ready to run.

Testing in
TestOps/sec
getElementById + jQuery Object
$(document.getElementById('foo'));
ready
jQuery Selector
$('#foo');
ready
realgetelementbyid
document.getElementById('foo');
ready

Revisions

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